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.
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
- reportMeter->incrementValue(incrementAmount);
- Increases the Meter counter by the specified amount.
- reportMeter->incrementValue();
- Increases the Meter counter by one.