dotnet / dotnet-api-docs

.NET API reference documentation (.NET 5+, .NET Core, .NET Framework)
https://docs.microsoft.com/dotnet/api/
Other
725 stars 1.56k forks source link

Add information on using V2 performance counters #10610

Open steveharter opened 6 days ago

steveharter commented 6 days ago

Type of issue

Additional information needed.

Description

Performance counters are implemented as either V1 or V2, and V2 is not fully supported. This should be documented as well as any workaround such as using lower-level P/Invoke calls discussed at https://learn.microsoft.com/windows/win32/perfctrs/using-the-pdh-functions-to-consume-counter-data.

For V2, CounterSample.CounterTimeStamp uses a different "origin point" for the time affecting other members such as NextValue() leading to zeros being returned, for example.

An example of a V2 performance counter is "HTTP Service Request Queues\MaxQueueItemAge".

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.performancecounter?view=net-8.0

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Diagnostics/PerformanceCounter.xml

Document Version Independent Id

2d744cbe-19e0-46da-2b4c-d87599c4b877

Article author

steveharter

dotnet-issue-labeler[bot] commented 6 days ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

dotnet-issue-labeler[bot] commented 6 days ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.