Standard: System.Diagnostics.PerformanceCounter Plans?

Created on 9 Jun 2017  路  6Comments  路  Source: dotnet/standard

Are there plans to add PerformanceCounter to the spec?

I have a .NET Core 2.0 application and I would like to use the PerformanceCounters, particularly on Windows.

Thanks.

All 6 comments

We plan on making them available on .Net Core but not neccessarily adding them to .NET Standard. @danmosemsft @brianrob

I'll echo @Petermarcu's statement. We are looking at what it will take to bring them to .NET Core for Windows, but I don't expect them to be added to the standard.

Can you tell me what specifically you'd like to do with the performance counter APIs? Specifically, are you interested in reading or writing counters? Which counters (process counters, runtime counters, custom counters)?

My particular use case is gathering stats. I am using them to get the CPU usage across all the cores. Currently I have to do this two ways. For Linux, I read /proc/stat. For Windows, I P/Invoke a DLL that calls the Win32 versions of the functions and exposes a C interface. Specifically I am using the "% Processor Time" counters.

I am also using P/Invoke on both platforms to get memory usage.

My ideal state is to have APIs such that I don't have to do any of that. P/Invoke isn't that big of a deal, but maintaining the seperate C DLL is a bit of a pain.

Thank you for the information and the feedback.

@ciband, thanks for the feedback. It's helpful to understand the use cases.

Sounds like there isn't any action for this in the standard repo. Closing issue. @ciband if there is further questions about the .NET Core implementation please file an issue in the corefx repo.

brianrob, you mean you don't understand the use cases for a technology that people have been using since--I believe--.net 1.0 days? WTF?

Was this page helpful?
0 / 5 - 0 ratings