Skip to content

Commit

Permalink
numeric issues (alibaba#1982)
Browse files Browse the repository at this point in the history
  • Loading branch information
XenoAmess authored Dec 3, 2021
1 parent 17cd0b6 commit 6f8d38f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public synchronized void create() {
if (timer == null) {
timer = new Timer("Timer-for-arthas-monitor-" + process.session().getSessionId(), true);
timer.scheduleAtFixedRate(new MonitorTimer(monitorData, process, command.getNumberOfLimit()),
0, command.getCycle() * 1000);
0, command.getCycle() * 1000L);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public int compare(ThreadVO o1, ThreadVO o2) {
// Compute cpu usage
final HashMap<ThreadVO, Double> cpuUsages = new HashMap<ThreadVO, Double>(threads.size());
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);
}

Expand Down

0 comments on commit 6f8d38f

Please sign in to comment.