【问题标题】:Performance Counter greater than 100%性能计数器大于 100%
【发布时间】:2013-05-07 08:08:29
【问题描述】:

我正在跟踪进程的 CPU 利用率,作为应用程序常规心跳的一部分,使用类似于以下的代码:

  var process = Process.GetCurrentProcess();
  _processCpuCounter = new PerformanceCounter("Process", "% Processor Time", process.ProcessName);
  ...
  ...
  ...
  var processCPU = Convert.ToInt32(_processCpuCounter.NextValue());

NextValue 每分钟只评估一次。

我观察到processCPU 的值大于 100%,谁能解释为什么会发生这种情况,因为它在数学上没有意义?

【问题讨论】:

    标签: c# .net performancecounter


    【解决方案1】:

    CPU 的每个内核都有 100%,因此双核上的 120% 可能意味着一个为 100%,另一个为 20%。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-01
    • 1970-01-01
    • 2012-03-19
    • 1970-01-01
    • 1970-01-01
    • 2014-11-18
    相关资源
    最近更新 更多