What is the story of Performance Counters for .NET Core?
Solution 1
This package is exactly equivalent of .NET Framework Performance Counters and can be used in .NET Core apps under Windows:
https://www.nuget.org/packages/System.Diagnostics.PerformanceCounter/
Solution 2
In the Windows Compatibility Pack for .NET Core will be support for Performance Counters
https://www.nuget.org/packages/Microsoft.Windows.Compatibility
Of course, it is a Windows only feature for now.
Solution 3
Performance counters are not in Linux thus not in NET Core. Create another "Full NET based helper application" to expose performance counters as service to "NET Core Application"
MaYaN
Updated on June 14, 2022Comments
-
MaYaN almost 2 years
Under Windows, one is able to read .NET performance counters using the following:
- Performance Monitor
- C# using
PerformanceCounter
- WMI and querying the .NET related classes
Considering the recent release of .NET Core and the fact that such app can also run in Linux, how can one access the .NET related stats currently available on Windows?
-
Digicoder about 7 yearsMaYaN already said that targeting Windows only is not an option
-
Damien_The_Unbeliever over 5 yearsMay help other people but the OP specifically stated that the still wanted to target Linux.