0

我正在尝试PerformanceCounterCategory通过使用PerformanceCounterCategory.GetInstanceNames()方法枚举 a 的所有实例名称并获得以下异常:

Load factor needs to be between 0.1 and 1.0.
Parameter name: loadFactor
EXCEPTION: System.ArgumentOutOfRangeException
   at System.Collections.Hashtable..ctor(Int32 capacity, Single loadFactor)
   at System.Diagnostics.CategorySample..ctor(Byte[] data, CategoryEntry entry, PerformanceCounterLib library)
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String category)
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category)
   at System.Diagnostics.PerformanceCounterCategory.GetCounterInstances(String categoryName, String machineName)
   at System.Diagnostics.PerformanceCounterCategory.GetInstanceNames()
   at Abc.Xyz.Utilities.PerfCounter.InitCounter()

我已经检查了性能计数器类别并且它存在。

有什么建议么?

4

0 回答 0