RawValue或NextValue

时间:2015-05-12 16:22:39

标签: c# asp.net performancecounter instrumentation

我有一个非常简单的问题,我认为之前已经回答过,但我找不到任何关于我正在寻找的内容的确切而简单的参考。

我有一个控制台实用程序应用程序,根据输入参数,获取每个Web应用程序或每个Windows服务的性能计数器列表。

我的简单问题是:NextValue应该读取哪些计数器以及RawValue使用什么计数器?

由于我的实用程序需要快速运行(2秒以内),我想有效地读取每个计数器。例如,我知道Process /%Processor Time必须通过NextValue读取,而Process / Working Set可以通过RawValue读取。

我试图让我的应用程序根据PerfCounterType(NumberItems32,CounterXXX等)决定,这可以工作,但我只需要有关如何阅读每个的确切简单的直接信息。

我的早期结论似乎是所有必须通过NextValue读取所有内容以提高准确性,但由于经验是有些人可以做RawValue,然后更好地通过第二次获得它并避免需要1秒睡眠。

这是潜在的计数器列表,我获得了类型:

# Bytes in all Heaps = NumberOfItems32
# Gen 0 Collections = NumberOfItems32
# Gen 1 Collections = NumberOfItems32
# Gen 2 Collections = NumberOfItems32
# Induced GC = NumberOfItems32
# of current logical Threads = NumberOfItems32
# of current physical Threads = NumberOfItems32
# of Exceps Thrown / sec = RateOfCountsPerSecond32
# of Exceps Thrown = NumberOfItems32
# of marshalling = NumberOfItems32
# of Sink Blocks in use = NumberOfItems32
% Processor Time = Timer100Ns
% Time in GC = RawFraction
Bytes Received = NumberOfItems64
Bytes Sent = NumberOfItems64
Cache % Process Memory Limit Used = RawFraction
Cache % Process Memory Limit Used = RawFraction
Cache Total Entries = NumberOfItems32
Cache Total Entries = NumberOfItems32
Cache Total Entries = NumberOfItems32
Channels = NumberOfItems32
Connections Established = NumberOfItems32
Context Proxies = NumberOfItems32
Current Queue Length = NumberOfItems32
Errors Unhandled During Execution = NumberOfItems32
Errors Unhandled During Execution = NumberOfItems32
Errors Unhandled During Execution = NumberOfItems32
Finalization Survivors = NumberOfItems32
Forms Authentication Failure = NumberOfItems32
Forms Authentication Failure = NumberOfItems32
Forms Authentication Success = NumberOfItems32
Forms Authentication Success = NumberOfItems32
Gen 0 heap size = NumberOfItems32
Gen 1 heap size = NumberOfItems32
Gen 2 heap size = NumberOfItems32
Handle Count = NumberOfItems32
Large Object Heap size = NumberOfItems32
Remote Calls/sec = RateOfCountsPerSecond32
Request Wait Time = NumberOfItems32
Request Wait Time = NumberOfItems32
Requests Executing = NumberOfItems32
Requests Executing = NumberOfItems32
Requests Executing = NumberOfItems32
Requests In Application Queue = NumberOfItems32
Requests In Application Queue = NumberOfItems32
Requests In Application Queue = NumberOfItems32
Requests Succeeded = NumberOfItems32
Requests Succeeded = NumberOfItems32
Requests Succeeded = NumberOfItems32
Requests Timed Out = NumberOfItems32
Requests Timed Out = NumberOfItems32
Requests Timed Out = NumberOfItems32
Requests/Sec = RateOfCountsPerSecond32
Requests/Sec = RateOfCountsPerSecond32
Requests/Sec = RateOfCountsPerSecond32
Sessions Active = NumberOfItems32
Sessions Active = NumberOfItems32
Sessions Active = NumberOfItems32
Thread Count = NumberOfItems32
Total Remote Calls = NumberOfItems32
Working Set - Private = NumberOfItems64

0 个答案:

没有答案