Reporting Performance Data with Meters

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

Meters are created by using the lookupMeter member function of the Listener, a Container, or an Event:
Meter *lookupMeter(meterName);

The meterName variable is a string that 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 creates a Meter object only when that object does not exist. If the object exists, the existing object is returned.

Meters can be used by the application to generate a "current snapshot" of relevant performance data values, which can 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 tasks:

  • The current number of entries in a cache that is maintained by the application.
  • The amount of memory that is allocated to the cache.
  • The number of important resources that are currently in use, such as the number of users that are logged in, which can be used for licensing purposes.

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 can be set later by the application through the setValue member function. The counter can also be increased by calling incrementValue:
reportMeter->incrementValue(incrementAmount);
Increases the Meter counter by the specified amount.
reportMeter->incrementValue();
Increases the Meter counter by one.
Remember: IBM® System Dashboard for Enterprise Content Management 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
.