Project

General

Profile

Websockets Monitoring

Subir Jolly
Added almost 5 years ago

Guys,

I was wondering if there's a way to see the number of users currently logged-in in monitoring(--monitoring) who are using websockets?

Thanks,

Subir


Replies (10)

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 5 years ago

Each connections manager has metric called: Open connections. You have to check it for the web sockets connection manager component - ws2s.

You can either query monitor for metric: ws2s/Open connections or get all the metrics from the server and find this one.

Added by Subir Jolly almost 5 years ago

I will take a look at the Open Connections in the basic monitoring provided. Also, I was wondering if there's cli for getting all these stats provided by the basic monitoring?

Thanks,

Subir

Added by Subir Jolly almost 5 years ago

Can you tell me the link to ws2s/Open connections metrics page? I can't seem to be able to find the path to this data on monitoring page.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 5 years ago

What monitoring page are you talking about?

There are a few ways to get statistics from the server:

  1. I have attached a very simple Groovy script which connects to the server via JMX and dumps all Tigase metrics to a text file. While this, itself may not be super useful it is a good start to implement something for your needs.

  2. Another option is to use Tigase Monitor: https://projects.tigase.org/projects/tigase-monitor/files

  3. You can use JConsole to connect via JMX and get all the Tigase statistics, this option is not very convenient but it works

  4. You can use any XMPP client with a good support for service discovery and ad-hoc commands (Psi) and access server metrics via XMPP.

  5. I am not sure, Andrzej will confirm but you can also use our command line management tool to access the server statistics: https://projects.tigase.org/projects/tclmt/files

StatsDumper.groovy (1.31 KB) StatsDumper.groovy Groovy script to dump all Tigase metrics to text file

Added by Subir Jolly almost 5 years ago

I am talking about the Agent View which is provided by tigase-extras + OpenDMK. I am attaching the screenshot of the page for reference.

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 5 years ago

This has very limited use. Only a small portion of Tigase metrics is available through HTTP. Maybe there is a way to browse some how all stats, but I really recommend to use regular JMX instead.

Added by Wojciech Kapcia TigaseTeam almost 5 years ago

Subir Jolly wrote:

I am talking about the Agent View which is provided by tigase-extras + OpenDMK. I am attaching the screenshot of the page for reference.

It provides similar funcionality to JMX itself, you can navigate to "StatisticsProvider" (i.e. http://:/ViewObjectRes//tigase.stats%3Atype%3DStatisticsProvider and at the bottom use one of "List of MBean operations", for example for websocket specific options enter "ws2c" as component and "0" for level, i.e. http://:/InvokeAction//tigase.stats%3Atype%3DStatisticsProvider/action=getComponentStats?action=getComponentStats&compName%2Bjava.lang.String=ws2c&level%2Bint=0

Added by Sam Wright almost 5 years ago

Wojciech Kapcia wrote:

Subir Jolly wrote:

I am talking about the Agent View which is provided by tigase-extras + OpenDMK. I am attaching the screenshot of the page for reference.

It provides similar funcionality to JMX itself, you can navigate to "StatisticsProvider" (i.e. http://:/ViewObjectRes//tigase.stats%3Atype%3DStatisticsProvider and at the bottom use one of "List of MBean operations", for example for websocket specific options enter "ws2c" as component and "0" for level, i.e. http://:/InvokeAction//tigase.stats%3Atype%3DStatisticsProvider/action=getComponentStats?action=getComponentStats&compName%2Bjava.lang.String=ws2c&level%2Bint=0

Artur,

There was a typo in this link. The correct link works: http://:/InvokeAction//tigase.stats%3Atype%3DStatisticsProvider/action=getComponentStats?action=getComponentStats&compName%2Bjava.lang.String=ws2s&level%2Bint=0

Added by Subir Jolly almost 5 years ago

Actually, we probably want both ws2s and ws2c. When we browse to the link posted by Sam Wright, it works fine and dumps a lot of data. But when we try to go to the following link Wojcieh provided, we get nothing as data.

http://<host>:<port>/InvokeAction//tigase.stats%3Atype%3DStatisticsProvider/action=getComponentStats?action=getComponentStats&compName%2Bjava.lang.String=ws2c&level%2Bint=0

I have searched for ws2c in tigase.org and did not really find any substantial documentation to validate that ws2c is not a typo. Please verify if it were a typo or not.

Thanks,

Subir

Added by Wojciech Kapcia TigaseTeam almost 5 years ago

Actually you are right there was a typo in the original link - there is no component @wc2c@, there is only @ws2s@.

    (1-10/10)