retrieving jmx tabular data

John Mazzitelli mazz at redhat.com
Tue Oct 5 15:49:28 UTC 2010


On 10/05/2010 11:35 AM, Bala Nair wrote:
 > We have a number of jmx enabled applications which expose "complex"
 > data types using the TabularDataSupport class in javax management.
...
 > This data is all trait type data
...
 > We don't need a historical record.

You are describing what RHQ calls measurement "traits". Traits are 
"metric data" that rarely change value. In the UI you view traits in a 
different subtab under Measurement tab.

As an example on how to implement, your resource component could extend 
the JMX plugin's JMXServerComponent (to get all the rest of the JMX 
plugin functionality) and you'd override the getValues() - your 
getvalues() implementation would get the TabularDataSupport object, 
extract out your trait data, and store the trait data in the Measurement 
Report. The plugin container will take it from there (it will bundle the 
report up in a message to the server and the server stores that 
information as traits.

In your plugin descriptor, your <metric> definition needs to indicate 
the metric value is a trait by specifying dataType="trait". e.g.:

       <metric property="Trait.SigarVersion"
               displayName="SIGAR Version"
               dataType="trait"
               displayType="summary"
               description="The version of the SIGAR (System Information 
Gatherer and Reporter) native library used by the Agent" />

As an example of how this is done today, see the agent plugin, 
specifically, here's the getValues method:

org.rhq.plugins.agent.AgentServerComponent.getValues(MeasurementReport, 
Set<MeasurementScheduleRequest>)

NOTE: what constitutes a "trait" versus a dynamic measurement value is 
sometimes not clear cut. Sometimes you could represent a trait value as 
a normal measurement data type... and vice versa. It depends on how you 
want the data represented to the user and if you think your data won't 
change that often and you don't care about past values.


More information about the rhq-devel mailing list