public class ThreadPoolStatistics extends Object
ThreadPoolExecutor| 构造器和说明 |
|---|
ThreadPoolStatistics(ThreadPoolExecutor threadPoolExecutor) |
| 限定符和类型 | 方法和说明 |
|---|---|
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<com.alipay.sofa.common.thread.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<com.alipay.sofa.common.thread.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 © 2021. All rights reserved.