core view application status and statistics


In daily development, we need to pay attention to the resource usage of. Net applications to facilitate troubleshooting and capacity expansion.

Obtain statistical information through Ajax request and display it as a chart, as shown in the following figure:

Clrstats plug-in is a plug-in for statistics of. Net application resource usage, including CPU utilization, GC and thread. It supports obtaining status information through web requests (access path and authentication can be customized). The data will be returned in JSON format.

GitHub address:

  • Support. Net framework > = 4.5
  • Support. Net core > = 2.0


Clrstats can be obtained from nuget website. You can use the following command to install it:

PM> Install-Package CLRStats


The warehouse samples folder contains examples of MVC and core.


The project needs to create a new owin startup file. The configuration is as follows:

public class Startup
	public void Configuration(IAppBuilder app)

After configuration, enable the project by accessing the site/clrPath, you can get the following information:

{“Server”:{“MachineName”:”DESKTOP-ZH5FQFC”,”SystemDateTime”:”2021/1/24 20:05:44″},”Application”:{“CPU”:{“UsagePercent”:1.171875},”GC”:{“Gen0CollectCount”:0,”Gen1CollectCount”:0,”Gen2CollectCount”:0,”HeapMemory”:60529392,”HeapMemoryFormat”:”57 M”,”IsServerGC”:true},”Thread”:{“AvailableCompletionPortThreads”:1000,”AvailableWorkerThreads”:8190,”UsedCompletionPortThreads”:0,”UsedWorkerThreads”:1,”UsedThreadCount”:39,”MaxCompletionPortThreads”:1000,”MaxWorkerThreads”:8191}}}


In this example, the access path will be customized and the authentication function will be added.

Identity authentication needs to inherit the idashboardauthorizationfilter class and implement the authorize method. The code is as follows:

public class TokenVerification : IDashboardAuthorizationFilter
	public bool Authorize(HttpRequest request)
		if (request.Headers.ContainsKey("Token") && request.Headers["Token"].Equals("test"))
			return true;
		return false;

Customize the access path and add identity authentication. In the configure method of startup class, add the following configuration:

app.UseCLRStatsDashboard("/custom-link", new DashboardOptions()
	Authorization = new IDashboardAuthorizationFilter[] { new TokenVerification() }

After configuration, enable the project by accessing the site/custom-linkPath, and the request header needs to carry the token parameter with the value of: test to access successfully.

Use curl tool under Windows system to test. The command is as follows:

curl "http://localhost:4409/custom-link" --header "Token: test"

As shown below: