amurty
Enthusiast
Enthusiast

multiple metric values in one call

If I define 3 metrics in hq-plugin.xml , the measurement class is called/invoked 3 seperate times.

Example - I have defined 3 metrics - X1 , X2 , X3 in the plugin xml file. Collection frequency is set at 5 mins.

Every 5 minutes, the measurement class is invoked by agent. this invokation happens 3 times. Each time, the measurement class has to return a value corresponding to the metric for which the invocation was made.

Is it possible to return multiple metric values within one invocation?

That is, the measurement class is invoked once, and it returns values for X1 , X2 and X3.

And are there any plugins in the HQ codebase that do this already ?

Danke.

4 Replies
amurty
Enthusiast
Enthusiast

anyone ?

0 Kudos

From Scott F:

there is another type of measurement plugin called a collector. 

An example of this is in the sybase plugin and here is a code example of the declaration in the plugin:

   <plugin type="collector"
            class="SybaseSysmonCollector"/>
instead of:
    <plugin type="measurement"
            class="org.hyperic.hq.product.MeasurementPlugin"/>
check the SybaseSysmonCollector class to see how it is used.
amurty
Enthusiast
Enthusiast

awesome, thanks!

0 Kudos
amurty
Enthusiast
Enthusiast

Also found a simpler/less complex example of a collector implementation  - The NTP plugin.

Java class is here - /src/org/hyperic/hq/plugin/ntp/NTPDCollector.java

You can also find it here - http://git.springsource.org/hq/hq/blobs/master/hq-plugin/ntp-plugin/src/main/java/org/hyperic/hq/plu...

0 Kudos