Reporting Performance Data with Meters

Meters are similar to Accumulators in that they maintain the min and max values for an aggregation interval over some period of time. However, Meters differ from Accumulators in that they represent an absolute value which is set directly by the application and as a result, changes in their value are not calculated by Managers.

Meters are created using the lookupMeter method of the Listener, a Container, or an Event:

Meter lookupMeter(meterName);

The meterName parameter is a Unicode String which provides the name for the Meter that may contain any printable characters excluding the newline character.

Meters can be used by the application to generate a "current snapshot" of relevant performance data values, which may increase or decrease over time. While they would not be appropriate for providing the number of database queries, Meters would be appropriate for reporting the following:

Changing the Meter Counter Value

Each Meter has a long counter value. When the object is first created, the counter is set to zero. The value may later be set by the application using the setValue method. The counter may also be increased by calling incrementValue:

NOTE The System Manager automatically calculates the min and max values of the Meter over each aggregation interval. For more information about the aggregation interval, see Configuring the Aggregation Interval.