Class ThreadExecutorStatsMXBeanImpl
java.lang.Object
org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean
org.opendaylight.controller.md.sal.common.util.jmx.ThreadExecutorStatsMXBeanImpl
- All Implemented Interfaces:
ThreadExecutorStatsMXBean
public class ThreadExecutorStatsMXBeanImpl
extends AbstractMXBean
implements ThreadExecutorStatsMXBean
MXBean implementation of the ThreadExecutorStatsMXBean interface that retrieves statistics
from a backing
ExecutorService.- Author:
- Thomas Pantelis
-
Field Summary
Fields inherited from class org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean
BASE_JMX_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionThreadExecutorStatsMXBeanImpl(ThreadPoolExecutor executor, String beanName, String beanType, @Nullable String beanCategory) Constructs an instance for the givenExecutor. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new bean if the backing executor is a ThreadPoolExecutor.Creates a new bean if the backing executor is a ThreadPoolExecutor and registers it.Creates a new bean if the backing executor is a ThreadPoolExecutor and registers it.longReturns the active thread count.longReturns the completed task count.longReturns the current queue size.longReturns the current thread pool size.Returns the largest queue size, if available.longReturns the largest thread pool size.longReturns the maximum queue size.longReturns the maximum thread pool size.Returns the rejected task count, if available.longReturns the total task count.Returns aThreadExecutorStatsinstance containing a snapshot of the statistic metrics.Methods inherited from class org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean
getMBeanCategory, getMBeanName, getMBeanType, register, registerMBean, unregister, unregisterMBean
-
Constructor Details
-
ThreadExecutorStatsMXBeanImpl
public ThreadExecutorStatsMXBeanImpl(ThreadPoolExecutor executor, String beanName, String beanType, @Nullable String beanCategory) Constructs an instance for the givenExecutor.- Parameters:
executor- the backingExecutorbeanName- Used as thenameproperty in the bean's ObjectName.beanType- Used as thetypeproperty in the bean's ObjectName.beanCategory- Used as theCategoryproperty in the bean's ObjectName.
-
-
Method Details
-
create
public 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.- Parameters:
executor- the backingExecutorbeanName- Used as thenameproperty in the bean's ObjectName.beanType- Used as thetypeproperty in the bean's ObjectName.beanCategory- Used as theCategoryproperty in the bean's ObjectName.- Returns:
- a registered ThreadExecutorStatsMXBeanImpl instance if the backing executor is a ThreadPoolExecutor, otherwise null.
-
create
public static ThreadExecutorStatsMXBeanImpl create(Executor executor, String beanName, String beanType) Creates a new bean if the backing executor is a ThreadPoolExecutor and registers it.- Parameters:
executor- the backingExecutorbeanName- Used as thenameproperty in the bean's ObjectName.beanType- Used as thetypeproperty in the bean's ObjectName.- Returns:
- a registered ThreadExecutorStatsMXBeanImpl instance if the backing executor is a ThreadPoolExecutor, otherwise null.
-
create
Creates a new bean if the backing executor is a ThreadPoolExecutor.- Parameters:
executor- the backingExecutor- Returns:
- a ThreadExecutorStatsMXBeanImpl instance if the backing executor is a ThreadPoolExecutor, otherwise null.
-
getCurrentThreadPoolSize
public long getCurrentThreadPoolSize()Description copied from interface:ThreadExecutorStatsMXBeanReturns the current thread pool size.- Specified by:
getCurrentThreadPoolSizein interfaceThreadExecutorStatsMXBean
-
getLargestThreadPoolSize
public long getLargestThreadPoolSize()Description copied from interface:ThreadExecutorStatsMXBeanReturns the largest thread pool size.- Specified by:
getLargestThreadPoolSizein interfaceThreadExecutorStatsMXBean
-
getMaxThreadPoolSize
public long getMaxThreadPoolSize()Description copied from interface:ThreadExecutorStatsMXBeanReturns the maximum thread pool size.- Specified by:
getMaxThreadPoolSizein interfaceThreadExecutorStatsMXBean
-
getCurrentQueueSize
public long getCurrentQueueSize()Description copied from interface:ThreadExecutorStatsMXBeanReturns the current queue size.- Specified by:
getCurrentQueueSizein interfaceThreadExecutorStatsMXBean
-
getLargestQueueSize
Description copied from interface:ThreadExecutorStatsMXBeanReturns the largest queue size, if available.- Specified by:
getLargestQueueSizein interfaceThreadExecutorStatsMXBean
-
getMaxQueueSize
public long getMaxQueueSize()Description copied from interface:ThreadExecutorStatsMXBeanReturns the maximum queue size.- Specified by:
getMaxQueueSizein interfaceThreadExecutorStatsMXBean
-
getActiveThreadCount
public long getActiveThreadCount()Description copied from interface:ThreadExecutorStatsMXBeanReturns the active thread count.- Specified by:
getActiveThreadCountin interfaceThreadExecutorStatsMXBean
-
getCompletedTaskCount
public long getCompletedTaskCount()Description copied from interface:ThreadExecutorStatsMXBeanReturns the completed task count.- Specified by:
getCompletedTaskCountin interfaceThreadExecutorStatsMXBean
-
getTotalTaskCount
public long getTotalTaskCount()Description copied from interface:ThreadExecutorStatsMXBeanReturns the total task count.- Specified by:
getTotalTaskCountin interfaceThreadExecutorStatsMXBean
-
getRejectedTaskCount
Description copied from interface:ThreadExecutorStatsMXBeanReturns the rejected task count, if available.- Specified by:
getRejectedTaskCountin interfaceThreadExecutorStatsMXBean
-
toThreadExecutorStats
Returns aThreadExecutorStatsinstance containing a snapshot of the statistic metrics.
-