|
|
@ -118,7 +118,7 @@ public class ThreadSampler {
|
|
|
|
// Compute cpu usage
|
|
|
|
// Compute cpu usage
|
|
|
|
final HashMap<ThreadVO, Double> cpuUsages = new HashMap<ThreadVO, Double>(threads.size());
|
|
|
|
final HashMap<ThreadVO, Double> cpuUsages = new HashMap<ThreadVO, Double>(threads.size());
|
|
|
|
for (ThreadVO thread : threads) {
|
|
|
|
for (ThreadVO thread : threads) {
|
|
|
|
double cpu = sampleIntervalNanos == 0 ? 0 : (deltas.get(thread) * 10000 / sampleIntervalNanos / 100.0);
|
|
|
|
double cpu = sampleIntervalNanos == 0 ? 0 : (Math.rint(deltas.get(thread) * 10000.0 / sampleIntervalNanos) / 100.0);
|
|
|
|
cpuUsages.put(thread, cpu);
|
|
|
|
cpuUsages.put(thread, cpu);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|