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 member function of the Listener, a Container, or an Event:

Meter *lookupMeter(meterName);

The meterName is a string which provides the name for the Meter. The lookupMeter constructor is overloaded to allow the string to be passed as Unicode (const wchar_t *) that contains any printable UTF-8 characters excluding the newline character. It will create a Meter object only when that object does not already exist. If the object already exists, the existing object is returned.

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 signed 64-bit 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 member function. 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.