fixed CPU UsagePercent Error (#2222)
fixed CPU UsagePercent Error The cpu usage storage longitude should be one percent, not one in ten thousand. When the storage unit is one ten thousandth, as long as the usage rate does not exceed 100%. Stored values are less than one. When the current query is forced to be converted to a long type, it will always be 0. This is not correct.
This commit is contained in:
parent
f7ca26729d
commit
5003d6da31
|
|
@ -46,6 +46,6 @@ public abstract class CPUMetricAccessor {
|
|||
long now = System.nanoTime();
|
||||
|
||||
CPU.Builder cpuBuilder = CPU.newBuilder();
|
||||
return cpuBuilder.setUsagePercent(cpuCost * 1.0d / ((now - lastSampleTimeNs) * cpuCoreNum)).build();
|
||||
return cpuBuilder.setUsagePercent(cpuCost * 1.0d / ((now - lastSampleTimeNs) * cpuCoreNum) * 100).build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue