fixed the getTasks method and replaced the usage of deprecated set method

Signed-off-by: Ravi Kumar <kumarravi1165@gmail.com>
This commit is contained in:
Ravi Kumar 2020-12-18 17:54:09 +05:30
parent d5648c73a1
commit 69a2558883
1 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ public class MonitoredQueuedThreadPool extends QueuedThreadPool
{ {
long taskLatency = System.nanoTime() - start; long taskLatency = System.nanoTime() - start;
threadStats.decrement(); threadStats.decrement();
taskLatencyStats.set(taskLatency); taskLatencyStats.record(taskLatency);
} }
} }
@ -110,7 +110,7 @@ public class MonitoredQueuedThreadPool extends QueuedThreadPool
@ManagedAttribute("the number of tasks executed") @ManagedAttribute("the number of tasks executed")
public long getTasks() public long getTasks()
{ {
return taskLatencyStats.getTotal(); return taskLatencyStats.getCount();
} }
/** /**