ASP.NET Live Activity Monitor

I have many HTTPHandlers in my server. How can I control the performance of my web server in Live?
I need the following statistics:
1. Requests per second (of each handler or resume)
2. CPU usage

Thanks in advance

+3
source share
1 answer

Please try these links and this line of code, this will certainly help you.

http://www.codeproject.com/KB/dotnet/perfcounter.aspx http://www.aspheute.com/english/20000809.asp http://www.csharphelp.com/2006/05/performance-monitoring/

PerformanceCounter System.Diagnostics:

PerformanceCounter cpuCounter;
PerformanceCounter ramCounter;

cpuCounter = new PerformanceCounter();

cpuCounter.CategoryName = "Processor";
cpuCounter.CounterName = "% Processor Time";
cpuCounter.InstanceName = "_Total";

ramCounter = new PerformanceCounter("Memory", "Available MBytes");


public string getCurrentCpuUsage(){
            cpuCounter.NextValue()+"%";
}

public string getAvailableRAM(){
            ramCounter.NextValue()+"MB";
}

.

+6

Source: https://habr.com/ru/post/1737154/


All Articles