Using the WebLogic Diagnostic Framework Console Extension
Working with Metrics Charts and Graphs
Metrics charts and graphs plot the values of MBean instances and attributes. The values can be real-time polled metric values obtained from a running WebLogic Server, or they can provide a historical view of that metric value for all metrics maintained by the WLDF Harvester.
To create charts and graphs based on metrics data, you drag metrics attributes from the Metrics tab to the View panel. Each new graph shows the value of the selected attribute over time.
The following sections describe how to work with metrics charts and graphs:
- Selecting a Server
- Understanding the Contents of the MBean Tree in the Metrics Tab
- Displaying Items in the Metrics tab
- Displaying Details About MBean Instances and Attributes in the Metrics Tab
- Displaying Details About Metrics Charts and Graphs
- Creating Custom Metrics
For general information about working with metrics charts and graphs and with method performance charts and graphs, see Working with All Charts and Graphs.
Selecting a Server
The Metrics tab displays metrics available for a single server at a time. The Server drop-down list displays all the servers in the domain.
To select a different server:
- Select the server from the Server drop-down list.
- Click the Reload button. The metrics for the selected server are displayed. If, however, the selected server is not running (is currently shut down), the drop-down list reverts back to the previously selected server.
Understanding the Contents of the MBean Tree in the Metrics Tab
The Metrics tab displays a tree containing the following:
- WebLogic MBean types
- Currently registered instances of the WebLogic MBean types
- Currently registered instances of custom MBean types
- Attributes of the listed registered instances
Table 7-1 describes the icons in the tree:
Table 7-1 Visual Cues in the MBean Tree in the Metrics tab Icon Represents... WebLogic MBean type JMX MBean type Custom MBean type MBean instance Attribute of an MBean instance
Displaying Items in the Metrics tab
The tree shows the MBean types, instances, and attributes for a server. Display items in the Metrics tab, as follows:
- To view the MBeans from a different server in the domain, select the server from the Server drop-down list. (You can display MBeans from only one server instance at a time, but you can create a chart using data from more than one server.)
- To refresh the tree for the selected server, click the Reload button.
- To show all currently registered instances of a listed MBean type, click the
(Expand) button to the left of the type name.
If the MBean type has no registered instances, the name of the MBean type appears in a gray, italic font. If no instances are registered, you cannot expand the node.
- To show all attributes of a listed MBean instance, click the
(Expand) button to the left of the MBean name.
Displaying Details About MBean Instances and Attributes in the Metrics Tab
You can display details about MBean instances and attributes by placing the mouse pointer over items in the tree of MBeans displayed in the Metrics tab:
- Point to an MBean instance name to display the full object name of the MBean instance.
- Point to an MBean attribute name to display the type and description of the attribute.
For more information about displaying these kinds of details, see Displaying Tooltips for Controls, Views, Graphs, and Charts.
Displaying Details About Metrics Charts and Graphs
You can display details about metrics charts and graphs displayed in the View panel by pointing the mouse pointer at objects in the panel:
- Point to a data point in a graph to display the time/date at which the point was plotted and the sampled metric value at that time.
- Point to a chart legend to display the object instance name for each attribute listed in the legend.
- Point to a chart scroll bar to display the beginning data and time and the ending date and time for the visible interval.
For information about displaying these details, see Displaying Tooltips for Controls, Views, Graphs, and Charts.
Creating Custom Metrics
You can track a metric based on an attribute of any registered MBean simply by dragging the attribute to a chart. You can also create more complex custom metrics by performing a variety of functions on one or more MBean instance attribute values. The custom metric is then available for creating graphs for all instances of a type.
To create a custom metric:
- In the Metrics tab, right-click the name of the MBean type for which you want to create a custom metric.
- From the context menu, select Create Custom Metric. The Custom Metric Editor is displayed in the right panel, replacing any view displayed in the View panel.
The Custom Metric Editor provides comprehensive help through tooltips. To display a tooltip, point the mouse at a field, function, or item in an expression, then pause for a moment until the tooltip is displayed.
- Define a custom metric by constructing an expression in the Expression field of the Custom Metric Editor, as follows:
- To insert a function, drag the function from the Available Functions box and drop it into the appropriate position in the Expression field. The available functions are explained in Table 7-2, Table 7-3, and Table 7-4. The positions where you can drop an item are described later in this step.
- To insert a simple metric based on an MBean attribute, drag the attribute (metric) from the Metrics tab and drop it into the appropriate position in the Expression field. (You can also drag a previously defined custom metric into the Expression field to create a nested custom metric.)
- To edit a scalar value in an expression, right click the value in the Expression field, select Edit from the context menu, then enter a new value.
- To delete an item from the expression in the Expression field, right-click the item, then select Delete from the context menu.
The Custom Metric Editor enforces where you can drop a function or attribute. When you drag an item to an allowed position in the Expression field, the position is highlighted to indicate you can drop an item there. You can drop into the following positions:
- Drag a metric or a function directly onto another metric or function to replace it.
If no metric or function has yet been inserted where one is required, The placeholder <MP> (that is, a metric placeholder) appears wherever a metric or function is required but none has yet been added. You can drag a function or metric onto any occurrence of <MP>.
- Drag a function onto an insert area to insert it into that position, without replacing any existing items. Any terms to the right of the inserted function are included as the first argument to the function.
To display symbols that indicate where the insert areas are, check the Show Insert Areas checkbox under the Expression field.
- Click Save to save the metric or Cancel to close the Custom Metric Editor without saving the metric.
When you display the Custom Metric Editor for an MBean type, you can use the editor to build an expression for that MBean type only. If you want to create a custom metric for a different MBean type, save or cancel the expression you are building, then right-click the different MBean type to create a custom metric for it.
Editing and Deleting Custom Metrics
To edit or delete a custom metric:
- In the Metrics tab, find the MBean type for which you defined the custom metric.
- Click the
icon next to the name of the MBean type to display its instances, if they are not already displayed.
- Click the
icon of any MBean instance to display its metrics, if none are already displayed. A custom metric defined for an MBean type is displayed for every MBean instance derived from the type.
- Right click the name of the custom metric.
- Select Edit Custom Metric to edit it or Delete Custom Metric to delete it (you can't delete the metric if it is currently included in a chart). When you edit a custom metric, it is changed for every MBean instance of the type. When you delete a custom metric from the list of metrics for an MBean instance, it is deleted from all the instances of the type.
Changing the Name of a Custom Metric
To create a copy of a custom metric:
- In the Metrics tab, find the MBean type for which you defined the custom metric whose name you want to change.
- Right-click the name of the custom metric.
- Select Edit Custom Metric.
- In the Metric Name field, change the metric's name.
- Click Save.
Creating a Copy of a Custom Metric
To create a copy of a custom metric:
- In the Metrics tab, find the MBean type for which you defined the custom metric you want to copy.
- Right-click the name of the custom metric.
- Select Edit Custom Metric.
- In the Metric Name field, change the metric's name.
- Click Save As.
Functions for Creating Custom Metrics
The Available Functions box in the Custom Metric Editor lists all the functions you can use to construct an expression. To display a note about what each function does, point the mouse to the function and pause. A tooltip is displayed. The functions are listed by type and explained in the following tables:
- Table 7-2, Functions Accepting Vector and/or Scalar Data but Not Requiring State from Previous Data
- Table 7-3, Functions Accepting Vector and/or Scalar Data and Requiring State from Previous Data
- Table 7-4, Functions that Operate Over an Interval
In the tables, <MP> represents a function or a defined metric.
Table 7-2 describes functions that accept vector and/or scalar data but do not require a computed state from previous data for comparing results.
Table 7-3 describes functions that accept vector and/or scalar data and that do require a computed state from previous data for computing results.
Table 7-4 describes functions that operate over an interval.