pcp
[Top] [All Lists]

Review: expand the scope of pmie logical and/or expressions

To: kmcdonell@xxxxxxxxxx
Subject: Review: expand the scope of pmie logical and/or expressions
From: Nathan Scott <nscott@xxxxxxxxxx>
Date: Tue, 19 Jun 2007 16:31:09 +1000
Cc: pcp@xxxxxxxxxxx
Organization: Aconex
Reply-to: nscott@xxxxxxxxxx
Sender: pcp-bounce@xxxxxxxxxxx
Hi Ken,

Any chance you could look over the attached patch for me please?
This implements the changes to the pmie logical OR operator that
we discussed - namely, allowing an expression to evaluate to true
when only one side of the expression tree can be evaluated (i.e.
due to host down / instance unavailable / insufficient samples).

I realised a similar issue exists with the AND operator after we
spoke, in that it can successfully evaluate to false even though
it may not have all data available for an expression.

The patch seems to work correctly for the following test cases,
but wouldn't mind you taking a detailed look, with your pmie-fu
black belt on.  It takes the approach we discussed, of pulling
these "special" operators out of the skeleton/generated code
infrastructure and hand-coding them (based on the original code).

Thanks!

16:10 nathans@edge ~/pmie 133> cat testor

one = some_inst (sample.noinst > 0)
        -> print "Should be unknown always\n";
two = some_inst (sample.noinst > 0) && hinv.ncpu > 0
        -> print "Should be false always\n";
three = some_inst (sample.noinst > 0) || hinv.ncpu > 0
        -> print "Should be true if fixed\n";
four = some_inst (0 < sample.noinst) || hinv.ncpu > 0
        -> print "Should be true if fixed\n";
five = sample.bad.unknown == 42 || hinv.ncpu > 0
        -> print "Should be true if fixed\n";
six = sample.bad.unknown == 42 || some_inst (sample.noinst > 0)
        -> print "Should always be unknown\n";
seven = some_inst (sample.noinst > 0) && hinv.ncpu == 0
        -> print "Should be false if fixed\n";


16:12 nathans@edge ~/pmie 134> pmie -c testor -v -t 1 pmie: metric
sample.bad.unknown not currently available from host edge
pmLookupDesc failed: Unknown or illegal metric identifier
pmie: metric sample.bad.unknown not currently available from host edge
pmLookupDesc failed: Unknown or illegal metric identifier
one: ?
two: ?
three: ?
four: ?
five: ?
six: ?
seven: ?

one: ?
two: ?
three: ?
four: ?
five: ?
six: ?
seven: ?


16:13 nathans@edge ~/pmie 135> /source/git/pcp/src/pmie/src/pmie -c
testor -v -t 1
pmie: metric sample.bad.unknown not currently available from host edge
pmLookupDesc failed: Unknown or illegal metric identifier
pmie: metric sample.bad.unknown not currently available from host edge
pmLookupDesc failed: Unknown or illegal metric identifier
Tue Jun 19 16:13:09 2007: Should be true if fixed

Tue Jun 19 16:13:09 2007: Should be true if fixed

Tue Jun 19 16:13:09 2007: Should be true if fixed

one: ?
two: ?
three: true
four: true
five: true
six: ?
seven: false

Tue Jun 19 16:13:10 2007: Should be true if fixed

Tue Jun 19 16:13:10 2007: Should be true if fixed

Tue Jun 19 16:13:10 2007: Should be true if fixed

one: ?
two: ?
three: true
four: true
five: true
six: ?
seven: false

16:13 nathans@edge ~/pmie 136>

Attachment: pmie.diff
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>
  • Review: expand the scope of pmie logical and/or expressions, Nathan Scott <=