サーバーコードにたくさんのHTTPHandlerがあります。
LiveでWebサーバーのパフォーマンスを監視するにはどうすればよいですか?
次の統計が必要です:
1。(各ハンドラーまたはサマリーの)1秒あたりの要求数2.CPU
使用率
前もって感謝します
これらのリンクとこれらのコード行を試してみてください。これは確かに役立ちます。
http://www.codeproject.com/KB/dotnet/perfcounter.aspx http://www.aspheute.com/english/20000809.asp http://www.csharphelp.com/2006/05/performance-monitoring/
System.DiagnosticsのPerformanceCounterクラスを使用できます。
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";
}
これらすべてがあなたの問題を解決します。