pcp
[Top] [All Lists]

Re: [pcp] RFC - pmie "ruleset" extension

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Subject: Re: [pcp] RFC - pmie "ruleset" extension
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Mon, 23 Jun 2014 19:44:21 -0400 (EDT)
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <53A8AB4E.9090003@xxxxxxxxxxxxxxxx>
References: <53A8AA17.5070205@xxxxxxxxxxxxxxxx> <53A8AB4E.9090003@xxxxxxxxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: yt6kWTYCkbdDUETv/HXObHlG2wwIKA==
Thread-topic: RFC - pmie "ruleset" extension
Hi Ken,

----- Original Message -----
> [...]
> And the multistate example becomes
> 
>       ruleset
>               extreme_predicate -> print "panic"
>       else    bad_predicate -> print "alarm"
>       else    unusual_predicate -> print "warning"
>       else    print "OK";
> 
> I've done enough of the implementation to know this will work for the
> parser and the execution engine without major disruption.
> 

Oh, I'm a big fan of this approach - I remember us chatting about it back
when Aconex first encountered this problem (back when I proposed to do it
in one day for a hackathon - rightly becoming the subject of much mirth!).

One issue was the way there isn't just true or false, there's also "maybe"
(first sample for a counter, or host is down) - what would be the approach
there?  Would it just fall through into that final else catch-all branch?
Heh, that would be the one that says "OK" above?  ;)  Might need some other
syntax for that case?

> Of course "ruleset ... else ... ;" could be replaced by "if ... elif ...
> elif ... else ...;" or any equivalent cosmetic change to the suggested
> syntax.

(personally I don't have a strong preference either way)

> Warm up the flame throwers ...

Not at all, as far as I'm concerned - if you think this is doable, I'd love
to see it happen.  I know of some production environments where it would be
immediately put to use.

cheers.

--
Nathan

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