public class WebSocketMessageBrokerStats
extends java.lang.Object
@EnableWebSocketMessageBroker
for Java config and
<websocket:message-broker>
for XML.
By default aggregated information is logged every 15 minutes at INFO level.
The frequency of logging can be changed via setLoggingPeriod(long)
.
This class is declared as a Spring bean by the above configuration with the
name "webSocketMessageBrokerStats" and can be easily exported to JMX, e.g. with
the MBeanExporter
.
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.ThreadPoolExecutor |
inboundChannelExecutor |
private static Log |
logger |
private long |
loggingPeriod |
private java.util.concurrent.ScheduledFuture<?> |
loggingTask |
private java.util.concurrent.ThreadPoolExecutor |
outboundChannelExecutor |
private java.util.concurrent.ScheduledThreadPoolExecutor |
sockJsTaskScheduler |
private StompBrokerRelayMessageHandler |
stompBrokerRelay |
private StompSubProtocolHandler |
stompSubProtocolHandler |
private SubProtocolWebSocketHandler |
webSocketHandler |
Constructor and Description |
---|
WebSocketMessageBrokerStats() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getClientInboundExecutorStatsInfo()
Get stats about the executor processing incoming messages from WebSocket clients.
|
java.lang.String |
getClientOutboundExecutorStatsInfo()
Get stats about the executor processing outgoing messages to WebSocket clients.
|
private java.lang.String |
getExecutorStatsInfo(java.util.concurrent.Executor executor) |
long |
getLoggingPeriod()
Return the configured logging period frequency in milliseconds.
|
java.lang.String |
getSockJsTaskSchedulerStatsInfo()
Get stats about the SockJS task scheduler.
|
java.lang.String |
getStompBrokerRelayStatsInfo()
Get stats about STOMP broker relay (when using a full-featured STOMP broker).
|
java.lang.String |
getStompSubProtocolStatsInfo()
Get stats about STOMP-related WebSocket message processing.
|
java.lang.String |
getWebSocketSessionStatsInfo()
Get stats about WebSocket sessions.
|
private java.util.concurrent.ScheduledFuture<?> |
initLoggingTask(long initialDelay) |
private StompSubProtocolHandler |
initStompSubProtocolHandler() |
void |
setInboundChannelExecutor(ThreadPoolTaskExecutor inboundChannelExecutor) |
void |
setLoggingPeriod(long period)
Set the frequency for logging information at INFO level in milliseconds.
|
void |
setOutboundChannelExecutor(ThreadPoolTaskExecutor outboundChannelExecutor) |
void |
setSockJsTaskScheduler(ThreadPoolTaskScheduler sockJsTaskScheduler) |
void |
setStompBrokerRelay(StompBrokerRelayMessageHandler stompBrokerRelay) |
void |
setSubProtocolWebSocketHandler(SubProtocolWebSocketHandler webSocketHandler) |
java.lang.String |
toString() |
private static Log logger
private SubProtocolWebSocketHandler webSocketHandler
private StompSubProtocolHandler stompSubProtocolHandler
private StompBrokerRelayMessageHandler stompBrokerRelay
private java.util.concurrent.ThreadPoolExecutor inboundChannelExecutor
private java.util.concurrent.ThreadPoolExecutor outboundChannelExecutor
private java.util.concurrent.ScheduledThreadPoolExecutor sockJsTaskScheduler
private java.util.concurrent.ScheduledFuture<?> loggingTask
private long loggingPeriod
public void setSubProtocolWebSocketHandler(SubProtocolWebSocketHandler webSocketHandler)
private StompSubProtocolHandler initStompSubProtocolHandler()
public void setStompBrokerRelay(StompBrokerRelayMessageHandler stompBrokerRelay)
public void setInboundChannelExecutor(ThreadPoolTaskExecutor inboundChannelExecutor)
public void setOutboundChannelExecutor(ThreadPoolTaskExecutor outboundChannelExecutor)
public void setSockJsTaskScheduler(ThreadPoolTaskScheduler sockJsTaskScheduler)
private java.util.concurrent.ScheduledFuture<?> initLoggingTask(long initialDelay)
public void setLoggingPeriod(long period)
By default this property is set to 30 minutes (30 * 60 * 1000).
public long getLoggingPeriod()
public java.lang.String getWebSocketSessionStatsInfo()
public java.lang.String getStompSubProtocolStatsInfo()
public java.lang.String getStompBrokerRelayStatsInfo()
public java.lang.String getClientInboundExecutorStatsInfo()
public java.lang.String getClientOutboundExecutorStatsInfo()
public java.lang.String getSockJsTaskSchedulerStatsInfo()
private java.lang.String getExecutorStatsInfo(java.util.concurrent.Executor executor)
public java.lang.String toString()
toString
in class java.lang.Object