What are JMX and PMI measures?
Use the Java Management Extension (JMX) to manage and monitor Java-based applications. The JMX interface invokes methods on MBeans to retrieve Performance Monitoring Infrastructure (PMI) data. AppMon supports JMX and provides an interface for third-party applications integration.
Goal of this tutorial
To explain how to do the following:
- Browse the MBeans and PMI groups on an application server.
- Add these attributes as measures.
- Add these measures to charts.
Use the easyTravel demo application for this demonstration. Add a custom JMX measure and chart it.
Step-by-step creation of PMI measures is not covered here, as it works exactly the same way.
1. Create a measure
- Open the System Profile Preferences > Measure dialog box.
- Click Create Measure. The Measure configuration dialog box appears.
- Find and select the Custom JMX Measure metric from the Server Side Performance > Agent based Measures > Cutom JMX group. You can hit Ctrl+F and type in
JMXto find it easily.
- In the Custom JMX Measure Specific Attributes section, click Browse Metrics. A warning message may appear, simply close it. The Metric browser dialog box appears.
- In the Agent group field, click Pick Agent. The Agent Browser dialog box appears.
- Select the BusinessBackend_easyTravel Agent, and click OK. The list of all MBeans for that Agent appears in the Metric browser dialog box.
- Select the required attribute. In this tutorial it's Active in tomcat.jdbc > ConnectionPool > <dataSourceName>. This tells you how many active connections data source has at any given time. You can hit Ctrl+F and type in
activeto find it easily.
- Give a meaningful name to your new measure. If needed, configure aggregation. If you want to use the new measure to define incidents, you need to configure thresholds as well. However, we're not doing it in this tutorial.
Note that the fields of Custom JMX Measure Specific Attributes section are populated with the selected data.
- Click Add to create a new measure, and then close the Measure configuration dialog box.
- Save the changes to the System Profile, and close the System Profile Preferences dialog box.
To create a PMI custom measure, select Custom PMI measure metric from Server Side Performance > Agent based Measures > WebSphere at the step 3.
JMX attribute note
If the JMX attribute type is a bean that provides getter methods to access measurement values, use the path expression to specify how to access the measurement values. If the bean provides the method
getValue(), which returns the desired measurement, access this value with a JMX subscription and set the path expression to
The following table provides values, path expressions and explanations for attribute types:
|Attribute Type||Desired Value||Path Expression||Explanation|
|nested getter||Return value of nested getter.||
|getter with parameter||Return value for specific parameter.||
|getter returning collection or array.||Aggregate of values in collection or array.||
||Iterates over elements of collection or array. For a map, it iterates over the values of the map.
|getter returning collection or array.||Value of a specific element of the collection or array||
||Fetches the element identified by
2. Chart the measure
To chart the new measure:
- Create a new dashboard, and add a Chart dashlet to it.
- Click Add Series.
- Select the measure you've just created and click Add. You can hit Ctrl+F and type in
JMXto find it easily.
- You have to wait, while AppMon gathers data with the new measure. Refresh the dashlet after some time, by hitting Ctrl+F5.