Smart Plug-in for WebLogic Server User's Guide

Chapter 5: WebLogic Server SPI User Defined Metrics
Introduction to User Defined Metrics
5-11
METRIC CALCULATIONS
The collector can perform calculations that combine one or more metrics to
define a new metric. These calculations are specified in the Metric Definitions
XML document using the Formula element as described in the previous section.
The result of the calculation is the metric value. See the section “Sample Metric
Definitions Document” for examples of calculated metrics.
SYNTAX
Calculations must use syntax as follows.
" Operators supported are +, -, /, *, and unary minus.
" Operator precedence and associativity follows the Java model.
" Parentheses can be used to override the default operator precedence.
" Allowable operands are metric IDs and literal doubles.
A metric ID can refer to either an MBean metric or another calculated metric.
Literal doubles can be specified with or without the decimal notation. The metric
ID refers to the
id attribute of the Metric element in the metric definitions
document.
The following example defines a metric whose value is the ratio (expressed as a
percent) of
Metric_1 to Metric_3.
<Formula>(Metric_1 / Metric_3) *100</Formula>
FUNCTIONS
The calculation parser also supports the following functions. All function names
are lowercase and take a single parameter which must be a metric ID.
" delta returns the result of subtracting the previous value of the
metric from the current value.
" interval returns the time in milliseconds that has elapsed since the
last time the metric was collected.
" sum returns the summation of the values of all the instances of a
multi-instance metric.