How to collect BE Profiler statistics from the command line using jmxterm

How to collect BE Profiler statistics from the command line using jmxterm

book

Article ID: KB0073498

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 5.x

Description

How can BE Profiler statistics be collected from the command line, as opposed to using a GUI tool like Jconsole or JVisual VM?
 

Issue/Introduction

This article describes how to use jmxterm to collect BE profile statistics.

Environment

All Supported Platforms

Resolution

Use jmxterm to connect to a running BE application via JMX. You may download the executable jar from:

https://docs.cyclopsgroup.org/jmxterm

To enter the jmxterm prompt, run the following from your terminal window:
java -jar jmxterm-1.0.2-uber.jar
From the jmxterm prompt, open a connection to the process ID of the running BE agent:
$> open 12345
..where 12345 is the process id of the BE agent.  The process id may be obtained with the jcmd utlitity (which comes with your TIBCO JRE installation under $TIBCO_HOME/tibcojre64/<version>/bin/).

Next, set the domain to com.tibco.be:
$> domain com.tibco.be
Set the bean to the BE Profiler mbean:
$> bean com.tibco.be:Group=Profiler,dir=Methods
Execute the StartFileBasedProfiler(agent-class-name, output-file-name, level-of-depth, duration-in-seconds) method. For example..
$> run StartFileBasedProfiler "inference-class" "C:/logs/be-profile.log" -1 60
The above command will profile the BE agent class named inference-class, and output the collected statistics to C:/logs/be-profile.log. The level of depth is set to ALL (-1), and statistics will be collected for a period of 60 seconds.

You may also combine the above commands into a single script file.  For example, create a file named jmxterm-simple.txt with the following content:
open 12345
domain com.tibco.be
bean com.tibco.be:Group=Profiler,dir=Methods
run StartFileBasedProfiler "inference-class" "C:/logs/be-profile.log" -1 60
close
quit
Then run the script using the command:
java -jar jmxterm-1.0.2-uber.jar -i jmxterm-simple.txt -n
For more details, refer the the jmxterm scripting guidance:

https://docs.cyclopsgroup.org/jmxterm/scripting