Measurement Plugin
Measurement Plugin Introduction
The MeasurementPlugin defines metrics and implements the getValue() method used to collect configured metrics. The method of collecting metrics is left entirely to the plugin. Support classes are provided to assist with certain collection methods such as SNMP, URL, JDBC, Windows Perflib Data and SIGAR. Following are some examples of collection methods used by various plugins:
- JMX - JBoss, WebLogic, WebSphere, Tomcat, Resin
- SNMP - Apache, iPlanet/SunONE, Apple Airport
- JDBC - Mysql, PostgreSQL, Oracle, Sybase
- Windows Perflib - .NET, Exchange, Terminal Services, IIS
- SIGAR - System, Server process metrics (NTP, Mysql, VMware, etc)
- Vendor API - Citrix Metaframe, DB2, WebSphere 4.x, SilverStream, VMware
<metric> Tag
Measurements are defined in the Plugin XML Descriptor using the <metric> tag. The following lists valid values for each attribute and their defaults.
- name - Name of the measurement, displayed in UI.
- alias - Abbreviated name of the measurement, used in the CLI.
Defaults to the value of the name attribute, stripped of any non letter or digit characters. - template - Measurement query passed to MeasurementPlugin.getValue()
The measurement template uses an extended form of a JMX ObjectName: domain:properties:attribute:connection-propertiesExample templatejboss.system:Type=ServerInfo:FreeMemory:naming.url=%naming.url%
Where:
- domain - jboss.system
- properties - Type=ServerInfo
- attribute - FreeMemory
- connection-properties - naming.url=%naming.url%
This is the extension to the JMX ObjectName format. Arbitrary properties generally used to connect to the managed server. In this case, JBoss JMX requires a JNP URL. The value is replaced by the MeasurementPlugin.tranlate method, using the inventory property value for this server instance.
A filter tag can be used to define the template attribute, combined with the default alias attribute to macro-ize templates. For example:
<filter name="template" value="jboss.system:Type=ServerInfo:${alias}:naming.url=%naming.url%"/> <metric name="Free Memory" indicator="true" units="B"/> <metric name="Used Memory" indicator="true" units="B"/>
Expands to:
<metric name="Free Memory" alias="FreeMemory" template="jboss.system:Type=ServerInfo:FreeMemory:naming.url=%naming.url%" indicator="true" units="B"/> <metric name="Used Memory" alias="UsedMemory" template="jboss.system:Type=ServerInfo:UsedMemory:naming.url=%naming.url%" indicator="true" units="B"/>
| Metric domains The metric domain can be used to invoke another plugin for handling common sources of metrics such as Process Information, Scripts, SQL Queries, and Network Services. See: [Plugin Examples]. |
- category - One of:
- AVAILABILITY
- PERFORMANCE
- THROUGHPUT
- UTILIZATION
If the name attribute is Availability, defaults to AVAILABILITY, otherwise defaults to UTILIZATION.
- units - Controls how the value is formatted in the UI. One of:
- none - Will not formatted.
- percentage
- B - Bytes
- KB - Kilobytes
- MB - Megabytes
- GB - Gigabytes
- TB - Terabytes
- epoch-millis - Time since January 1, 1970 in milliseconds.
- epoch-seconds - Time since January 1, 1970 in seconds.
- ns - Nanoseconds
- mu - Microseconds
- ms - Milliseconds
- jiffys - Jiffies (1/100 sec)
- sec - Seconds
- cents - Cents (1/100 of 1 US Dollar)
If the name attribute is Availability, defaults to percentage, otherwise defaults to none.
- collectionType - One of:
- dynamic - Value may go up or down.
- static - Value will not change or not graph such as a date stamp.
- trendsup - Value changes will always increase.
A per-minute rate measurement will be generated for each trendsup measurement. If the measurement has the defaultOn attribute set to true, it will be set to false and the generated rate measurement will be set to true. To disable the generated rate measurement, set the rate attribute to none. - trendsdown - Value changes will always decrease.
Defaults to dynamic.
- indicator - If true this measurement will be displayed on the indicators tab in the UI.
Defaults to false. - defaultOn - If true this measurement will be scheduled by default.
If indicator is true defaults to true. Otherwise defaults to false. - interval - Default collection interval in milliseconds.
If the name attribute is Availability, defaults are:- Platforms, 1 minute
- Servers, 5 minute
- Services, 10 minutes
Otherwise, defaults are: - collectionType dynamic, 5 minutes
- collectionType trendsup,trendsdown,10 minutes
- collectionType static, 30 minutes
- group - Measurement group
Currently unused by the server, in the future this attribute will used to group measurements in the UI. - rate - Specifies the measurement rate calculation. One of:
- 1s - 1 second
- 1m - 1 minute
- 1h - 1 hour
- none - disable generated rate metric
This attribute is only valid for metrics of collectionType trendsup.