VMware Cloud Community
ben_davis
Contributor
Contributor

MeasurementPlugin and template

I'm writing a plugin that extends the MeasurementPlugin and I am having trouble understanding what to put in the template value. Can anyone explain the format in more detail?

Also, the getValue() method gets called two times for each metric with different domainName values. What does that mean? How should I handle this in my overridden getValues() method?
Thanks for any advice.
0 Kudos
2 Replies
bjchip_hyperic
Enthusiast
Enthusiast

I've just done this the hard way. Hope it helps.

http://communities.vmware.com/thread/353902?tstart=0

I don't see my getValue getting called multiple times. Need to see your code and hq-plugin.xml to even guess.

respectfully
BJ
0 Kudos
ben_davis
Contributor
Contributor

BJ,
Thanks you! Following your example I fixed my template and now my plugin is working as expected. My problem was in setting the domain and type. This is what I have now:

${domain}:Type=MyTestPlugin:${alias}:testprop=testvalue

where domain is the package name and MyTestPlugin is the class name of my plugin. The last field can be retrieved with metric.getPropString() in the getValue() method.
0 Kudos