HP

HPjmeter 4.1 User's Guide

English
  HPjmeter 4.1 User's Guide > Chapter 4 Monitoring Applications   

Using the JMX Viewer

The JMX viewer provides access to data collected from the operation of JMX servers inside the Java Virtual Machine for Java 1.5.x versions.

The viewer also provides you with the ability to interject in some operations of the JVM and to manipulate the operation and attributes of MBeans that you have defined. Using HPjmeter monitoring displays, you can observe the effect of changing the characteristics of MBeans that you have loaded into the JMX server of the virtual machine.

Opening the JMX viewer   On opening a session with an application running on Java 1.5.x, a data node displays in the main console to represent current data collected from the JVM.

Figure 4-4 Main Console Showing an Expanded JMX Server Node in an Open Session

Main Console Showing an Expanded JMX Server Node in an Open Session

To access this summary data, double-click on the summary JMX server node. The summary JMX Viewer opens. For information on this part of the JMX Viewer, see Understanding the JMX Summary View.

To manipulate some JVM and MBean functions on this server, expand the summary node and double-click the entry labeled Modify JMX MBean data. The server JMX Viewer opens. For information on this part of the JMX Viewer, see Changing Mbean Values and Monitoring the Result

NOTE: This functionality is available only during an open session. No record of the actions taken within the JMX viewer are saved. To preserve a record of changes occurring in the application run due to manipulation of the JMX server and MBeans, save the monitoring session data for later review. Use the monitoring metric visualizers to view the saved data.

See also

Understanding the JMX Summary View

The JMX viewer opens in the Summary view with five tabs displayed:

JMX Summary Tab

The Summary tab shows a collection of data about the operating system and hardware, allocated memory, current heap usage, and class loading status. Values are updated throughout the duration of the open session.

Figure 4-5 Appearance of the Summary JMX Viewer When First Opened

Appearance of the Summary JMX Viewer When First Opened

JMX Memory Tab

Fluctuations in memory usage in heap and non-heap areas are graphically displayed and periodically updated for the duration of the open session. Mouse over the features of the graph to learn what spaces are represented, as well as to learn what each of the markers designates.

The following image demonstrates some of the features available on this tab.

Figure 4-6 JMX Viewer with Summary Memory Tab Selected

JMX Viewer with Summary Memory Tab Selected

Select a region of interest  Click the color bar in the graph to select the memory space of interest. The bar will become outlined in blue and the Region Details will update in the text area.

Consult the Region Details for updated information on memory usage in that region, total count of garbage collections, and cumulative duration of GC events.

Set a usage threshold  Where usage threshold can be set, a “0” (zero) appears in the Usage Threshold box. To set a threshold, replace the current value with a desired, valid value in the box, and press Enter. To see what values are valid for a region, mouse over the Usage Threshold box.

On pressing Enter, a red marker will appear on the region usage bar to mark the point at which the threshold is reached. The bar color turns red when the threshold is reached and a notification is generated.

Start verbose GC  At any point, you can click the verbose GC check box to start collection of verbose GC data by the JVM. The JVM usually writes this information to stdout. Uncheck the box to stop logging verbose GC data.

Perform a garbage collection  At any point, you can click the Perform GC button to force a System.gc garbage collection on the heap.

JMX Threads Tab

HPjmeter locates and tracks the live threads processing during the application run. This image shows available functions on the Threads tab.

Figure 4-7 JMX Viewer with Summary Threads Tab Open

JMX Viewer with Summary Threads Tab Open

See the list of live threads  Pull the slider in the data pane to the right to reveal the current list of live threads.

See details for a selected thread  Click a thread name in the left pane. Details on thread activity and current state appear in the right pane.

Apply a filter   This filtering text box is useful when the thread list is long. It allows you to reduce the list size according to the starting letters of the thread name. To apply a filter, start typing the first few distinguishing letters of the thread names that you are interested in. The list will immediately be trimmed to entries starting with those letters. Deleting text from the filter box returns the list to its original state.

Detect thread deadlock  At any point, you can check the box for “Detect Deadlock” to start monitoring specifically for thread deadlock conditions. When a deadlock condition is encountered for a particular thread, the text of the thread name turns red. Uncheck the box to stop watching for this condition.

JMX Runtime Tab

The Runtime tab summarizes important characteristics of the runtime environment, including data on the JVM version and uptime, options used to start the monitoring agent, and some aspects of the hardware and operating system such as memory assignment, swap space, and operating system type and version.

JMX Notifications Tab

Notifications triggered by changes that you make using the JMX viewer appear on the Notifications tab. They are available for viewing for the duration of the open session or until you clear them from the screen using the Clear All button.

See also The MBean Notifications Tab

Changing Mbean Values and Monitoring the Result

Use the JMX server view to select the MBeans that you want to look at in detail. The following image shows the default view on opening the JMX server view. An explanation follows the image.

Figure 4-8 Default View When Server JMX Viewer is Opened

Default view when JMX viewer is first
toggled to the JMX server view; the Attribute tab is open.

JMX MBean list filter  Click this button to see a list of the filters that you can apply to the MBean drop-down menu items at .

JMX server drop-down menu  The server from which this JMX viewer was launched is shown in the “JMX Servers” drop-down menu.

JMX MBean drop-down menu  This drop-down menu lists the viewable MBeans for which data can be displayed in the viewer. This list can get quite long when viewing data for application servers. To reduce the list length in the drop-down menu, click the MBean filter button at .

JMX MBean tab navigation  Select an MBean, and the data for that bean is displayed in the four tabs appearing immediately below the drop-down menus. Click among the tabs to looks at various aspects of the selected MBean. Four tabs are available in the JMX server view: Attributes, Operations, Notifications, and Information.

JMX MBean Details Viewer  In the Detail Viewer, you can drill down into the MBean data for details or to force an operation.

Using the Functions in the JMX Server View

The following discussion touches on the basic functions in this area of the JMX viewer.

The MBean Filter

Click the MBean filter button filter for MBeans to select a subset of MBeans to populate the MBean drop-down menu.

A small window opens that gives you the following options for sorting the MBeans:

  • by domain (for example, java.lang, com.bea)

  • by name (for example, ClassLoadingImpl, MBeanServerDelegate)

  • by type (for example,GarbageCollector, MemoryPool)

Select the filter type that you want, and click the Use Filter button.

Use the MBean drop-down menu to see the resulting list and to select an MBean to view.

The MBean Attribute Tab

The Attribute tab lists the contents of the selected MBean. In general, two actions are possible at this level: drill down to see values of an attribute and change the value of an attribute. The following image shows an example. An explanation follows the image.

Figure 4-9 MBean Attribute Tab Open for Display

Open attribute tab showing secondary
tab navigation in detail area and an example of a changeable value.

List of name/value pairs found in the selected MBean  The names are listed with their value. Values may be dynamically updating; you may open them to reveal further details as in , or you may edit them as in .

Clickable value  Names or values appearing in boldface type can be opened to display details in the Detail Viewer area. Double-click the boldface text to open a tab in the Detail Viewer as in . The tab remains open until you click the closure box on the tab or until you close the viewer.

Editable value  Values appearing in blue type can be changed. Click the blue text to open a text box. Type the change, and press Enter to immediately apply the change. To view the effect of the change, choose an appropriate monitoring metric.

Detail Viewer tab  Opens when boldface values are double-clicked. Tabs appearing in this area provide additional data or operations that you can modify and immediately apply. The detail tab remains available until you click the closure box on the tab or until you close the viewer.

The MBean Operations Tab

Not all MBeans have operations associated with them. This tab is grayed out when the selected MBean has no operation associated with it. The next figure shows an open Operations tab with details about a particular MBean. An explanation follows the image.

Figure 4-10 MBean Operations Tab Open for Display

Open operations tab showing secondary
tab navigation in detail area and an example of a modifiable operational
function .

Selected Operation Name  The names are listed with their return type and number of arguments. By double-clicking a boldface name, the return type is highlighted and a tab opens in the Detail Viewer containing the operation and one or more editable text boxes. See and .

Operational detail tab  The detail tab remains available until you click the closure box on the tab or until you close the viewer.

Editable text box  Values appearing in text box can be changed. Type the change, and press the Operation_Name button to immediately apply the operational change. In this example, the operational button name is getThreadCpuTime . To view the effect of the change, choose an appropriate monitoring metric.

The MBean Notifications Tab

Not all MBeans have notifications associated with them. This tab is grayed out when this information is not present. The next figure shows an open Notifications tab with details about the selected MBean. An explanation follows the image.

Figure 4-11 MBean Notifications Tab Open for Display

MBean Notifications Tab Open for Display

Enable or disable notification  Click the check box to enable or disable the notification.

Notification detail tab  When the conditions for the notification are triggered, messages resulting from the event appear here. The detail tab remains available until you click the closure box on the tab or until you close the viewer.

The MBean Information Tab

The next figure shows an open Information tab with additional related information about the selected MBean. An explanation follows the image.

Figure 4-12 MBean Information Tab Open for Display

MBean Information Tab Open for Display

View classification information  Name/Value pairs are given that provide relational information for the selected MBean.