Package com.lightstreamer.jmx
Interface LoadMBean
public interface LoadMBean
One LoadMBean instance exists in the system, to provide information
related to the Server load. It is created at startup by
Lightstreamer Server and lasts until the shutdown of the Server.
LoadMBean name:
"com.lightstreamer:type=Load"
LoadMBean name:
"com.lightstreamer:type=Load"
-
Method Summary
Modifier and Type Method Description void
disableThreadInspection()
Resets the JVM flags which enable the JVM's computation of usage statistics on the threads.void
enableThreadInspection()
Tries to set the JVM flags which enable the JVM's computation of usage statistics on the threads.java.lang.Integer
getActiveNIOWriteSelectors()
java.lang.Integer
getActivePooledThreads()
java.lang.Integer
getAveragePoolQueueWait()
java.lang.Integer
getCurrentNIOWriteQueue()
java.lang.Long
getCurrentNIOWriteQueueWait()
java.lang.Integer
getDelayMillis()
java.lang.Integer
getExtraSleepMillis()
java.lang.Integer
getExtraWaitMillis()
java.lang.Integer
getQueueStageEvents()
java.lang.Integer
getQueueStageHandshake()
java.lang.Integer
getQueueStageHTTPAccept()
java.lang.Integer
getQueueStageMPNExecutor()
java.lang.Integer
getQueueStageMPNNotifier()
java.lang.Integer
getQueueStagePump()
java.lang.Integer
getQueueStageSnapshot()
java.util.List<java.lang.String>
getThreadPools()
java.lang.Integer
getTotalJVMThreads()
java.lang.Integer
getTotalNIOSelectors()
java.lang.Integer
getTotalPooledThreads()
java.lang.Integer
getTotalPoolQueue()
java.lang.Integer
getWaitingPooledThreads()
-
Method Details
-
getTotalJVMThreads
java.lang.Integer getTotalJVMThreads()- Returns:
- The total number of threads in the Java virtual machine.
-
getTotalPooledThreads
java.lang.Integer getTotalPooledThreads()- Returns:
- The global number of threads belonging to one of the thread pools used by Lightstreamer Server to manage the various processing stages. This value is the sum of getActivePooledThreads and getWaitingPooledThreads, but for possible further threads currently in a transition phase.
-
getActivePooledThreads
java.lang.Integer getActivePooledThreads()- Returns:
- The total number of threads belonging to one of the thread pools used by Lightstreamer Server which are currently executing a task.
-
getWaitingPooledThreads
java.lang.Integer getWaitingPooledThreads()- Returns:
- The total number of threads belonging to one of the thread pools used by Lightstreamer Server which are currently unused and waiting for a new task to be enqueued.
-
getQueueStageSnapshot
java.lang.Integer getQueueStageSnapshot()- Returns:
- The length of the queue of the tasks waiting to be processed by the "SNAPSHOT" thread pool. This pool manages the dispatching of snapshot related events to the sessions which issued a snapshot request.
-
getQueueStageEvents
java.lang.Integer getQueueStageEvents()- Returns:
- The length of the queue of the tasks waiting to be processed by the "EVENTS" thread pool. This pool manages the dispatching of each new update event to all sessions in which the involved item was subscribed to.
-
getQueueStagePump
java.lang.Integer getQueueStagePump()- Returns:
- The length of the queue of the tasks waiting to be processed by the "PUMP" thread pool. This pool manages the collection of all available updates for a session into a packet to be sent to the client.
-
getQueueStageHTTPAccept
java.lang.Integer getQueueStageHTTPAccept()- Returns:
- The length of the queue of the tasks waiting to be processed by the "ACCEPT" and "SERVER" thread pools or any of the optional thread pools that can be defined to override the latter for specific subsets of tasks. These pools manage reading and processing incoming client requests (this includes all kinds of client requests).
-
getQueueStageHandshake
java.lang.Integer getQueueStageHandshake()- Returns:
- The length of the queue of the tasks waiting to be processed by the "TLS-SSL HANDSHAKE" and "TLS-SSL AUTHENTICATION" thread pools. These pools manage the operations needed to accomplish all TLS/SSL handshakes, on connections to ports listening in https.
- Edition Note:
- TLS/SSL is an optional feature, available depending on Edition and License Type. To know what features are enabled by your license, please check out the com.lightstreamer.Edition bean.
-
getQueueStageMPNExecutor
java.lang.Integer getQueueStageMPNExecutor()- Returns:
- The length of the queue of the tasks waiting to be processed by the "MPN EXECUTOR" and "MPN TAKEOVER AND ADOPTION" thread pools. These pools manages the external database that maintains the state of the Push Notification service.
- Edition Note:
- MPN is an optional feature, available depending on Edition and License Type. To know what features are enabled by your license, please check out the com.lightstreamer.Edition bean.
-
getQueueStageMPNNotifier
java.lang.Integer getQueueStageMPNNotifier()- Returns:
- The length of the queue of the tasks waiting to be processed by the various "MPN XXX YYYYYYYYY" thread pools, where XXX represents any supported external Push Notifications service. These pools manage the submission of the Push Notifications to the external services.
- Edition Note:
- MPN is an optional feature, available depending on Edition and License Type. To know what features are enabled by your license, please check out the com.lightstreamer.Edition bean.
-
getTotalPoolQueue
java.lang.Integer getTotalPoolQueue()- Returns:
- The total number of queued tasks, waiting to be processed
by any of the thread pools used by Lightstreamer Server.
Note that, in case "Remote Metadata Adapters" are in use, the AUTHENTICATION and MSG pools of the corresponding "Proxy Metadata Adapters" are always defined and the queue count reported for these pools includes the requests currently in execution on the Remote Metadata Adapter. - See Also:
ThreadPoolMBean.getQueue()
,ThreadPoolMBean.getPendingAsyncTasks()
-
getAveragePoolQueueWait
java.lang.Integer getAveragePoolQueueWait()- Returns:
- The average waiting time in milliseconds experienced by the tasks whose processing by any of the thread pools used by Lightstreamer Server started in the last sampling period. A large or constantly increasing value may signal that some thread pool has all the available threads blocked.
-
getThreadPools
java.util.List<java.lang.String> getThreadPools()- Returns:
- A list with the internal names of all the thread pools currently used by the Server. The internal names are consistent with the pool names as expressed in the various configuration instructions. The names can be used as input to the various getPool* operations.
-
getCurrentNIOWriteQueue
java.lang.Integer getCurrentNIOWriteQueue()- Returns:
- The number of socket write operations currently waiting to be selected by the NIO selector. A steadily nonzero value may signal that some clients are not dequeueing the updates properly, unless the average wait times are very small.
-
getCurrentNIOWriteQueueWait
java.lang.Long getCurrentNIOWriteQueueWait()- Returns:
- The waiting time in milliseconds averaged over all the socket write operations currently waiting to be selected by the NIO selector. A large or constantly increasing value may signal that some clients are not dequeueing the updates properly.
-
getActiveNIOWriteSelectors
java.lang.Integer getActiveNIOWriteSelectors()- Returns:
- The number of NIO selectors currently used to handle socket write operations. The minimum number is determined by the Server. Temporary selectors can be added if a maximum number of tasks per selector is configured. In this case, it is also possible that the overall count of threads associated to different write-related selectors is higher than the count of the currently active ones.
-
getTotalNIOSelectors
java.lang.Integer getTotalNIOSelectors()- Returns:
- The number of NIO selectors currently used to handle all possible socket operations. The minimum number for each operation type is determined by the Server. Temporary selectors can be added if a maximum number of tasks per selector is configured.
-
getExtraSleepMillis
java.lang.Integer getExtraSleepMillis()- Returns:
- The average extra-time experienced for sleep() system calls. It is expected that the difference between the expected time and the observed time increases when the available CPU decreases, though significant delays with plenty of CPU available have sometimes been observed.
-
getExtraWaitMillis
java.lang.Integer getExtraWaitMillis()- Returns:
- The average time experienced between a notify() system call and the exit from the related wait() in a producer/consumer interaction. It is expected that this time difference increases when the available CPU decreases, though significant time differences with plenty of CPU available have sometimes been observed.
-
getDelayMillis
java.lang.Integer getDelayMillis()- Returns:
- A very heuristic indicator of how thread context switches are slow, due to high load. It is based on an exponentially weighted moving average of the most recent internal delays observed. The same samples used for getExtraSleepMillis and getExtraWaitMillis are used.
-
enableThreadInspection
void enableThreadInspection()Tries to set the JVM flags which enable the JVM's computation of usage statistics on the threads. This is necessary to enable the collection of these statistics on the thread pools (seeThreadPoolMBean.getAvgBlocksCount()
,ThreadPoolMBean.getAvgBlockedTime()
, andThreadPoolMBean.getAvgCPUTime()
).
Note that these are global JVM flags, that are used and managed by the JVM's ThreadMXBean (namely, via "setThreadContentionMonitoringEnabled" and "setThreadCpuTimeEnabled"), hence changing them also affects the overall JVM behavior and the ThreadMXBean in particular; likewise, changing them via the ThreadMXBean is equivalent to doing that here.
Also note that the specific JVM may not support the computation of these statistics, hence the statistics on the thread pools may remain disabled. -
disableThreadInspection
void disableThreadInspection()Resets the JVM flags which enable the JVM's computation of usage statistics on the threads. SeeenableThreadInspection()
.
Note that, by the JVM default, these flags are initially disabled.
-