public class ThreadPoolStatistics extends Object
ThreadPoolExecutor| Constructor and Description |
|---|
ThreadPoolStatistics(ThreadPoolExecutor threadPoolExecutor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTotalRunningTime(long runningTime)
add total running time
|
void |
addTotalStayInQueueTime(long stayInQueueTime)
add total stay in queue time
|
void |
addTotalTaskCount()
increase total task count
|
long |
getAverageRunningTime()
get the average running time
|
long |
getAverageStayInQueueTime()
get the average stay in queue time
|
Map<ExecutingRunnable,Long> |
getExecutingTasks()
Return the running tasks of the
ThreadPoolExecutor |
long |
getPoolSize()
Return the pool size og the
ThreadPoolExecutor |
long |
getQueueSize()
Return the queue size of the
ThreadPoolExecutor |
long |
getTotalTaskCount()
return the total task count
|
void |
resetAverageStatics()
reset each statics, it may cause the result inaccurate
|
public ThreadPoolStatistics(ThreadPoolExecutor threadPoolExecutor)
public Map<ExecutingRunnable,Long> getExecutingTasks()
ThreadPoolExecutorpublic long getQueueSize()
ThreadPoolExecutorpublic long getPoolSize()
ThreadPoolExecutorpublic void addTotalRunningTime(long runningTime)
runningTime - the added runningTimepublic void addTotalStayInQueueTime(long stayInQueueTime)
stayInQueueTime - the added stay in queue timepublic void addTotalTaskCount()
public long getTotalTaskCount()
public long getAverageRunningTime()
public long getAverageStayInQueueTime()
public void resetAverageStatics()
Copyright © 2024. All rights reserved.