What is Performance Co开发者_运维问答unter and how to use them in ASP.NET application.
Please explain.
From MSDN:
Counters are used to provide information as to how well the operating system or an application, service, or driver is performing. The counter data can help determine system bottlenecks and fine-tune system and application performance. The operating system, network, and devices provide counter data that an application can consume to provide users with a graphical view of how well the system is performing.
The .NET framework has several classes that allow you to use and create performance counters, the main ones are the PerformanceCounter
, PerformanceCounterCategory
and CounterCreationData
(for creating new counters).
From the documentation on the System.Diagnostics
namespace:
The PerformanceCounter class enables you to monitor system performance, while the PerformanceCounterCategory class provides a way to create new custom counters and categories. You can write to local custom counters and read from both local and remote counters (system as well as custom). You can sample counters using the PerformanceCounter class, and calculate results from successive performance counter samples using the CounterSample class. The CounterCreationData class enables you to create multiple counters in a category and specify their types. Other classes associated with the performance counter component provide access to collections of counters, counter permission, and counter types.
Refer here.. http://msdn.microsoft.com/en-us/library/fxk122b4.aspx
精彩评论