[pcp] Experimental patch (was Re: mmv pmda: stuff always fails the first time?)

Ken McDonell kenj at internode.on.net
Sat Nov 14 13:46:25 CST 2009

Thanks Martin.

May I have your permission to include these code snippets into the QA
suite ... clearly there is a coverage issue here.

For me, the code works and the metric appears and is being updated as

But there is a problem ... mmv.mymmv.export_value appears TWICE in the
PMNS with the same PMID ...
$ pminfo -m mmv
mmv.mymmv.export_value PMID: 70.1.1
mmv.mymmv.export_value PMID: 70.1.1
(and note mmv.reload is no longer in the PMNS)

I've seen the same thing with QA 647 where after the mmv PMDA is
installed, this metric appears (I have an independent pmdaproc.sh fix to
make the warning message go away from the Check line) ...

Check mmv metrics have appeared ... 1 metrics and 1 values
$ pminfo -fm mmv

mmv.reload PMID: 70.0.0
    value 0

but then as soon as the mmv PMDA has a data file to work on, mmv.reload
vanishes from the PMNS and mmv.test.strings appears twice in the PMNS.

$ pminfo -fm mmv

mmv.test.strings PMID: 70.1.6
    inst [0 or "zero"] value "00oo00"
    inst [1 or "hero"] value ""

mmv.test.string PMID: 70.1.5
    value "g'day world"

mmv.test.interval PMID: 70.1.4
    inst [0 or "bird"] value 0
    inst [1 or "tree"] value 0
    inst [2 or "eggs"] value 28

mmv.test.indom PMID: 70.1.3
    inst [0 or "zero"] value 43
    inst [1 or "hero"] value 0

mmv.test.discrete PMID: 70.1.2
    value 42

mmv.test.counter PMID: 70.1.1
    value 41

mmv.test.strings PMID: 70.1.6
    inst [0 or "zero"] value "00oo00"
    inst [1 or "hero"] value ""

Hopefully this is enough evidence for Nathan to go ... ahhhaa ... but if
that does not happen over the next day or so, I'll go digging some more.

On Sat, 2009-11-14 at 11:29 -0500, Martin Hicks wrote:
> On Sat, Nov 14, 2009 at 11:35:43AM +1100, Ken McDonell wrote:
> > Martin,
> > 
> > Any chance you can post gendata.sh and mmvtest.pl (or send me copies) so
> > I can investigate? ... this is certainly in a place where the dynamic
> > pmns changes were made.
> Attached.  It was my first, quick attempt to get something working, and
> an example for someone who wanted to extract a metric out of another
> commands stdout to export to PCP.
> mh

More information about the pcp mailing list