草庐IT

PerformanceCounters

全部标签

C#:访问 ".NET CLR Memory category"的 PerformanceCounters

我正在尝试访问位于".NETCLRMemorycategory"中的性能计数器通过C#使用PerformanceCounter类。但是,无法使用我期望的正确类别/计数器名称来实例化类别newPerformanceCounter(".NETCLRMemory","#bytesinallheaps",Process.GetCurrentProcess().ProcessName);我尝试使用以下代码循环遍历类别和计数器string[]categories=PerformanceCounterCategory.GetCategories().Select(c=>c.CategoryName)

C#:访问 ".NET CLR Memory category"的 PerformanceCounters

我正在尝试访问位于".NETCLRMemorycategory"中的性能计数器通过C#使用PerformanceCounter类。但是,无法使用我期望的正确类别/计数器名称来实例化类别newPerformanceCounter(".NETCLRMemory","#bytesinallheaps",Process.GetCurrentProcess().ProcessName);我尝试使用以下代码循环遍历类别和计数器string[]categories=PerformanceCounterCategory.GetCategories().Select(c=>c.CategoryName)