public class ThreadExecutorStatsMXBeanImpl extends AbstractMXBean implements ThreadExecutorStatsMXBean
ExecutorService
.BASE_JMX_PREFIX
Constructor and Description |
---|
ThreadExecutorStatsMXBeanImpl(ThreadPoolExecutor executor,
String beanName,
String beanType,
@Nullable String beanCategory)
Constructs an instance for the given
Executor . |
Modifier and Type | Method and Description |
---|---|
static ThreadExecutorStatsMXBeanImpl |
create(Executor executor)
Creates a new bean if the backing executor is a ThreadPoolExecutor.
|
static ThreadExecutorStatsMXBeanImpl |
create(Executor executor,
String beanName,
String beanType)
Creates a new bean if the backing executor is a ThreadPoolExecutor and registers it.
|
static ThreadExecutorStatsMXBeanImpl |
create(Executor executor,
String beanName,
String beanType,
@Nullable String beanCategory)
Creates a new bean if the backing executor is a ThreadPoolExecutor and registers it.
|
long |
getActiveThreadCount()
Returns the active thread count.
|
long |
getCompletedTaskCount()
Returns the completed task count.
|
long |
getCurrentQueueSize()
Returns the current queue size.
|
long |
getCurrentThreadPoolSize()
Returns the current thread pool size.
|
Long |
getLargestQueueSize()
Returns the largest queue size, if available.
|
long |
getLargestThreadPoolSize()
Returns the largest thread pool size.
|
long |
getMaxQueueSize()
Returns the maximum queue size.
|
long |
getMaxThreadPoolSize()
Returns the maximum thread pool size.
|
Long |
getRejectedTaskCount()
Returns the rejected task count, if available.
|
long |
getTotalTaskCount()
Returns the total task count.
|
ThreadExecutorStats |
toThreadExecutorStats()
Returns a
ThreadExecutorStats instance containing a snapshot of the statistic
metrics. |
getMBeanCategory, getMBeanName, getMBeanType, register, registerMBean, unregister, unregisterMBean
public ThreadExecutorStatsMXBeanImpl(ThreadPoolExecutor executor, String beanName, String beanType, @Nullable String beanCategory)
Executor
.executor
- the backing Executor
beanName
- Used as the name
property in the bean's ObjectName.beanType
- Used as the type
property in the bean's ObjectName.beanCategory
- Used as the Category
property in the bean's ObjectName.public static ThreadExecutorStatsMXBeanImpl create(Executor executor, String beanName, String beanType, @Nullable String beanCategory)
executor
- the backing Executor
beanName
- Used as the name
property in the bean's ObjectName.beanType
- Used as the type
property in the bean's ObjectName.beanCategory
- Used as the Category
property in the bean's ObjectName.public static ThreadExecutorStatsMXBeanImpl create(Executor executor, String beanName, String beanType)
executor
- the backing Executor
beanName
- Used as the name
property in the bean's ObjectName.beanType
- Used as the type
property in the bean's ObjectName.public static ThreadExecutorStatsMXBeanImpl create(Executor executor)
executor
- the backing Executor
public long getCurrentThreadPoolSize()
ThreadExecutorStatsMXBean
getCurrentThreadPoolSize
in interface ThreadExecutorStatsMXBean
public long getLargestThreadPoolSize()
ThreadExecutorStatsMXBean
getLargestThreadPoolSize
in interface ThreadExecutorStatsMXBean
public long getMaxThreadPoolSize()
ThreadExecutorStatsMXBean
getMaxThreadPoolSize
in interface ThreadExecutorStatsMXBean
public long getCurrentQueueSize()
ThreadExecutorStatsMXBean
getCurrentQueueSize
in interface ThreadExecutorStatsMXBean
public Long getLargestQueueSize()
ThreadExecutorStatsMXBean
getLargestQueueSize
in interface ThreadExecutorStatsMXBean
public long getMaxQueueSize()
ThreadExecutorStatsMXBean
getMaxQueueSize
in interface ThreadExecutorStatsMXBean
public long getActiveThreadCount()
ThreadExecutorStatsMXBean
getActiveThreadCount
in interface ThreadExecutorStatsMXBean
public long getCompletedTaskCount()
ThreadExecutorStatsMXBean
getCompletedTaskCount
in interface ThreadExecutorStatsMXBean
public long getTotalTaskCount()
ThreadExecutorStatsMXBean
getTotalTaskCount
in interface ThreadExecutorStatsMXBean
public Long getRejectedTaskCount()
ThreadExecutorStatsMXBean
getRejectedTaskCount
in interface ThreadExecutorStatsMXBean
public ThreadExecutorStats toThreadExecutorStats()
ThreadExecutorStats
instance containing a snapshot of the statistic
metrics.Copyright © 2019 OpenDaylight. All rights reserved.