-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieving websocket connections via jmx #5122
Comments
@sagarika-hp The When using WebSocket with Why do you think 52 is the incorrect value for the number of open connections? |
@lachlan-roberts is there a way to find out that if how many connections have got upgraded ? so when we say there are 52 connections how will i know if its an http upgrade connection or a websocket one. I am not saying its a wrong value ..trying to understand how its calculated . |
If you want stats for only websocket Connections you could try subclassing it to only get stats for instances of new ConnectionStatistics()
{
@Override
public void onOpened(Connection connection)
{
if (connection instanceof AbstractWebSocketConnection)
super.onOpened(connection);
}
@Override
public void onClosed(Connection connection)
{
if (connection instanceof AbstractWebSocketConnection)
super.onClosed(connection);
}
}; You can also get detailed info about the state of open WS sessions through a dump of the |
@lachlan-roberts perhaps we should make a |
…ctionStatistics Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
…n SessionTracker Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts when will this parameter be available in which release ? |
@sagarika-hp the PR is still under review but will likely be merged before a 9.4.32 release. |
Issue #5122 - Improve connection statistics for WebSocket
From 9.4.32 we will have the IncludeExcludeConnectionStatistics statistics = new IncludeExcludeConnectionStatistics();
statistics.include("org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection");
server.addBeanToAllConnectors(statistics); |
@lachlan-roberts is this documented yet? |
@joakime I don't think so, I'll put up a PR. |
Jetty version
9.4.31v
Java version
1.8
Question
I am trying to fetch the connection stats for my websocket server via jmx
so while fetching this mbean
org.eclipse.jetty.io:context=HTTP_1_1@15bb6bea,id=0,type=connectionstatistics
as part of the attributes ,i get the number of current connections value as
connections (long, r) =52
This is the number of HTTP upgrade connections that have happened or it tells me that these are the number of active websocket connection running in my server?. New to jetty so trying to understand the configurations.
And how can i get the number of active websocket connections via jmx ?
The text was updated successfully, but these errors were encountered: