Package com.lightstreamer.jmx
Interface ThreadPoolMBean
- 
 public interface ThreadPoolMBeanMultiple ThreadPoolMBean instances exist in the system, where each one is related to one internal thread pool in use. Every thread pool used internally by Lightstreamer Server is bound to one ThreadPoolMBean instance. The thread pools and the corresponding ThreadPoolMBean instances are created only when needed and, in some cases, may be closed and replaced, but most of them are created at startup and last until the shutdown of the Server. Note that the Server supports optional pools, which, when configured, handle tasks on behalf of more general "parent" pools. Optional pools not configured don't exist, hence there are no ThreadPoolMBean instances for them. Remote JMX clients should not deregister ThreadPoolMBean instances.
 
 ThreadPoolMBean name pattern:
 "com.lightstreamer:type=ThreadPool,name=<ThreadPoolName>"
 
 The list of the names of the thread pools currently in use is provided by the "ThreadPools" property of the global LoadMBean.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidendThreadInspection()Disables the collections of usage statistics on the threads of this pool.java.lang.IntegergetActiveThreads()java.lang.LonggetAggregatedQueue()java.lang.LonggetAvgBlockedTime()java.lang.LonggetAvgBlocksCount()java.lang.LonggetAvgCPUTime()java.lang.IntegergetAvgExecTimeMillis()java.lang.IntegergetAvgQueueWaitMillis()java.lang.IntegergetCurrentThreads()java.lang.IntegergetCurrQueueWaitMillis()java.lang.BooleangetIsCpuBound()java.lang.IntegergetMaxFreeThreads()java.lang.LonggetMaxQueue()java.lang.IntegergetMaxThreads()java.lang.IntegergetQueue()java.lang.DoublegetThroughput()java.lang.IntegergetWaitingThreads()voidstartThreadInspection()Enables the collections of usage statistics on the threads of this pool related togetAvgBlocksCount(),getAvgBlockedTime(), andgetAvgCPUTime(), which are collected through JVM internal services.
 
- 
- 
- 
Method Detail- 
getMaxThreadsjava.lang.Integer getMaxThreads() - Returns:
- The maximum number of threads allowed for this pool. For most pools, this value can be configured. A zero value means a potentially unlimited pool.
 
 - 
getMaxFreeThreadsjava.lang.Integer getMaxFreeThreads() - Returns:
- The maximum number of inactive threads allowed at any moment for this pool. For most non-cpu-bound pools, this value can be configured.
 
 - 
getMaxQueuejava.lang.Long getMaxQueue() - Returns:
- The maximum length of the task queue allowed for this pool, such that, if the maximum is reached, new client connections are refused by the Server. If -1, no limit is imposed. In case of an optional pool, it can also be null, to mean that the tasks for this pool are counted among the tasks of the parent pool.
 
 - 
getIsCpuBoundjava.lang.Boolean getIsCpuBound() - Returns:
- true if the pool is devoted to cpu-bound tasks, which means tasks in which no blocking operations are expected in normal working conditions.
 
 - 
getCurrentThreadsjava.lang.Integer getCurrentThreads() - Returns:
- The number of threads belonging to this thread pool; the number may vary in time, depending on the pool configuration.
 
 - 
getActiveThreadsjava.lang.Integer getActiveThreads() - Returns:
- The total number of threads belonging to this thread pool which are currently executing a task.
 
 - 
getWaitingThreadsjava.lang.Integer getWaitingThreads() - Returns:
- The total number of threads belonging to this thread pool which are currently unused and waiting for a new task to be enqueued.
 
 - 
getQueuejava.lang.Integer getQueue() - Returns:
- The length of the queue of the tasks currently waiting to be processed by this thread pool.
 
 - 
getAggregatedQueuejava.lang.Long getAggregatedQueue() - Returns:
- The length of the task queue currently considered for the check on the maximum queue length. It may consider optional pools whose count must fall into the count of this pool. The count is kept only if the "MaxQueue" property is set and it is not -1; otherwise null is returned.
 
 - 
getAvgQueueWaitMillisjava.lang.Integer getAvgQueueWaitMillis() - Returns:
- The average waiting time in milliseconds experienced by the tasks whose processing by this pool started in the last sampling period. A large or constantly increasing value may signal that the pool has all the available threads blocked.
 
 - 
getCurrQueueWaitMillisjava.lang.Integer getCurrQueueWaitMillis() - Returns:
- The waiting time cumulated by the first (hence oldest) task in the task queue of this thread pool. A large or constantly increasing value may signal that the pool has all the available threads blocked.
 
 - 
getThroughputjava.lang.Double getThroughput() - Returns:
- The rate of task execution by this thread pool in the last sampling period. Actually, this value may be approximated by using the number of tasks per second submitted to the pool in the same time frame. It is expressed as tasks per second; the value has a three decimal precision.
 
 - 
getAvgExecTimeMillisjava.lang.Integer getAvgExecTimeMillis() - Returns:
- The average execution time taken by the tasks executed on this thread pool, whose execution has terminated in the last sampling period. This statistics is significant for pools that are used to execute potentially blocking operations or heavy cpu-bound tasks; for any other pools the statistics is not measured and null is returned.
 
 - 
startThreadInspectionvoid startThreadInspection() Enables the collections of usage statistics on the threads of this pool related togetAvgBlocksCount(),getAvgBlockedTime(), andgetAvgCPUTime(), which are collected through JVM internal services. Such services, in turn, should be enabled as well; seeLoadMBean.enableThreadInspection().
 - 
endThreadInspectionvoid endThreadInspection() Disables the collections of usage statistics on the threads of this pool. SeestartThreadInspection()for details.
 Note that, by default, these statistics are initially disabled.
 - 
getAvgBlocksCountjava.lang.Long getAvgBlocksCount() - Returns:
- The number of times that the threads of this pool have been
 blocked on monitor entry in the last sampling period.
 The value is averaged among the various threads in the pool and
 normalized on a second. Note that such blocks can only occur during
 task execution, as idle threads are not in a blocked state. 
 However, the returned value is null if this kind of inspection is not enabled or not supported; seestartThreadInspection().
 
 - 
getAvgBlockedTimejava.lang.Long getAvgBlockedTime() - Returns:
- The time, in milliseconds, that the threads of this pool have
 spent blocked on monitor entry in the last sampling period.
 The value is averaged among the various threads in the pool and
 normalized on a second, so it should be between 0 and 1000. Note that
 such blocks can only occur during task execution, as task scheduling
 on the pools does not involve monitors. 
 However, the returned value is null if this kind of inspection is not enabled or not supported; seestartThreadInspection().
 
 - 
getAvgCPUTimejava.lang.Long getAvgCPUTime() - Returns:
- The time, in milliseconds, that the threads of this pool have
 spent consuming CPU in the last sampling period.
 The value is averaged among the various threads in the pool and
 normalized on a second, so it should be between 0 and 1000. 
 However, the returned value is null if this kind of inspection is not enabled or not supported; seestartThreadInspection().
 
 
- 
 
-