pcp
[Top] [All Lists]

Re: Derived metric issues

To: Lukas Berk <lberk@xxxxxxxxxx>
Subject: Re: Derived metric issues
From: fche@xxxxxxxxxx (Frank Ch. Eigler)
Date: Tue, 16 Feb 2016 11:47:46 -0500
Cc: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>, pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <8737ssptwp.fsf@xxxxxxxxxx> (Lukas Berk's message of "Tue, 16 Feb 2016 10:16:38 -0500")
References: <56B99888.2020408@xxxxxxxxxx> <56BA4445.2030404@xxxxxxxxxxxxxxxx> <8737ssptwp.fsf@xxxxxxxxxx>
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)
Lukas Berk <lberk@xxxxxxxxxx> writes:

> [...]
>> So the concept of an "error" here is a bit tricky ...
> [...]
> Perhaps it is simply up to the client author to interpret a return value
> of 0 accordingly?

The man page is not really helpful with that "accordingly" though:

       The result from pmLoadDerivedConfig will be the number of
       derived metrics loaded from files on the given path, else a
       value less than zero in the case of an error.

... because that "else" is not an "else" in the exclusive sense.  We
can have both errors -and- some derived metrics loaded.  So first
thing would be to clarify the language, so that an app author can know
what she can count on.

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.

- FChE

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