pcp
[Top] [All Lists]

RE: Derived metric issues

To: "'Frank Ch. Eigler'" <fche@xxxxxxxxxx>, "'Lukas Berk'" <lberk@xxxxxxxxxx>
Subject: RE: Derived metric issues
From: "Ken McDonell" <kenj@xxxxxxxxxxxxxxxx>
Date: Sun, 21 Feb 2016 14:50:51 +1100
Cc: <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <y0m7fi4bo0d.fsf@xxxxxxxx>
References: <56B99888.2020408@xxxxxxxxxx> <56BA4445.2030404@xxxxxxxxxxxxxxxx> <8737ssptwp.fsf@xxxxxxxxxx> <y0m7fi4bo0d.fsf@xxxxxxxx>
Thread-index: AQHUeX3N1oEBYQg8H015/Judt3cPQQFDvULXAgTHmS8Aercbb58Rp/Zg
> -----Original Message-----
> From: Frank Ch. Eigler [mailto:fche@xxxxxxxxxx]
> Sent: Wednesday, 17 February 2016 3:48 AM
> To: Lukas Berk <lberk@xxxxxxxxxx>
> Cc: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>; pcp@xxxxxxxxxxx
> Subject: Re: Derived metric issues
> ...
> Perhaps we can say it's a best-effort load attempt, and only result
> codes 0...N are to be expected.  (Ditch the negative error codes.)
> That gives the author no help as to which derived metrics were in fact
> loaded, but that's OK.  She'll find that out soon enough when trying a
> pmLookup* etc.

I checked the code in libpcp ... it was wrong and did not accumulate the
count of loaded definitions correctly when more than one file was processed.
That is now fixed.

I check the QA ... incomplete coverage of the error scenarios we're talking
about here ... qa/969 is new to address this.

In the process I discovered that bad derived metric specifications generate
quite verbose and succinct error messages!

And finally the man page now reads like this ...

       Because pmLoadDerivedConfig may process many files, each of which
may
       contain many derived metric specifications, it is not possible to pro
‐
       vide very specific error status on  return.   Hence  the  result
from
       pmLoadDerivedConfig will be the number of derived metrics
successfully
       loaded from files on the given path.  Catastrophic errors such as
not
       being  able  to  open one of the files on the given path will cause
an
       immediate return with a negative return value that can  be  passed
to
       pmErrStr(3) to obtain the associated error message.

       When errors are encountered in the derived metric specifications diag
‐
       nostic messages are generated by  pmRegisterDerived(3)  and
displayed
       via pmprintf(3).

I think that should suffice to close this issue.

<Prev in Thread] Current Thread [Next in Thread>