Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the story of Performance Counters for .NET Core?

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?

like image 716
MaYaN Avatar asked Jun 30 '16 13:06

MaYaN


3 Answers

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/

like image 122
Mahdi Ataollahi Avatar answered Oct 10 '22 13:10

Mahdi Ataollahi


In the Windows Compatibility Pack for .NET Core will be support for Performance Counters

https://www.nuget.org/packages/Microsoft.Windows.Compatibility

https://blogs.msdn.microsoft.com/dotnet/2017/11/16/announcing-the-windows-compatibility-pack-for-net-core/

Of course, it is a Windows only feature for now.

like image 34
NickD Avatar answered Oct 10 '22 14:10

NickD


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"

like image 22
SACn Avatar answered Oct 10 '22 15:10

SACn