How to get message statistics sent/received between members when using JGroups (TCP/UDP)?
-
20-04-2021 - |
Question
I am using JGroups TCP protocol to maintain cluster. I have been trying to get some statistics of number of messages sent and received and size of each message to create some reports. Is there a way I can capture this information?
Thanks in advance.
Solution
JGroups exposes most of this via JMX. You can access this information in 2 ways:
Run jconsole and attach to the running process. To do that, you have to set some JMX specific system properties when starting the process. Plus, you have to register the JGroups channel, e.g. use
JmxConfigurator.registerChannel()
to do this.Use probe.sh, e.g.
probe.sh jmx=NAKACK.xmit_table
dumps all attributes in NAKACK that start withxmit_table
. There is more info onprobe.sh
in the manual at jgroups.org.
Cheers.