I have an application(java) based on a websocket server(embedded jetty 8) and I'm looking for a method to return the number of current connections. Is there such a thing? thanks
Asked
Active
Viewed 1,880 times
1 Answers
0
http://wiki.eclipse.org/Jetty/Tutorial/Statistics
This would be one way to do it, another would be to enable jmx and pull from the beans. If you want a jmx + rest approach then you can use the setup described here:
http://webtide.intalio.com/2011/05/jetty-jmx-webservice/
Lastly, if you want to do it yourself you can look at how its gathered in the statistics handler and setup your own code for it.
(ok, I had deleted this, but am undeleting because it will give you the basics on what to look for in the code to do what you want, but it is not strictly and answer for websocket connection counts, I suspect we need to add that to the statistics servlet still)

jesse mcconnell
- 7,102
- 1
- 22
- 33