pcp
[Top] [All Lists]

RE: [pcp] Converting and SQL statement into a PMIE rule for evaluation a

To: "'Shirshendu Chakrabarti'" <shirshendu@xxxxxxx>, <pcp@xxxxxxxxxxx>
Subject: RE: [pcp] Converting and SQL statement into a PMIE rule for evaluation against pmlogger archives
From: "Ken McDonell" <kenj@xxxxxxxxxxxxxxxx>
Date: Sat, 22 Nov 2014 07:20:23 +1100
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <CALg+ggm7L0WXrKw66uCud200-SPQxkAhNbGu-o772p1ofaH+Sg@xxxxxxxxxxxxxx>
References: <CALg+ggm7L0WXrKw66uCud200-SPQxkAhNbGu-o772p1ofaH+Sg@xxxxxxxxxxxxxx>
Thread-index: AQEzM2NICEcvH5Znr/HJpXMR+feGaZ2lKWxQ
Shirsendu,

There is no generic tool that I'm aware of for translating SQL into pmie rules.

And in general this is not going to be possible due to things like differences 
in data models and value comparisons (pmie only works with numeric expressions).

But it may be possible in some restricted cases.  We'd probably need specific 
examples of the PCP metrics you're interested and some associated SQL queries.

> -----Original Message-----
> From: pcp-bounces@xxxxxxxxxxx [mailto:pcp-bounces@xxxxxxxxxxx] On
> Behalf Of Shirshendu Chakrabarti
> Sent: Wednesday, 19 November 2014 2:50 AM
> To: pcp@xxxxxxxxxxx
> Subject: [pcp] Converting and SQL statement into a PMIE rule for evaluation
> against pmlogger archives
> 
> Hi PCP Team,
> 
> Is there any way where we can translate a SQL query into a pmie rule which
> can be evaluated against a live stream of metrics data or against some
> pmlogger created archive.
> 
> An example of what I am trying to achieve:
> 
> SQL statement:
> 
> select attribute_1, attribute_2 from table where attribute_1 = 'some_val1'
> and attribute_2 = 'some_val2' group by 'attribute_1';
> 
> equivalent metrics, that need to be processed:
> 
> <appname>.<table>.<attribute_1>
> <appname>.<table>.<attribute_2>
> 
> 
> probable pmie rule:
> 
> result = some_inst (
>                               $<appname>.<table>.<attribute_1> = 'some_val1' 
> &&
>                               $<appname>.<table>.<attribute_1> = 'some_val2'
> ) -> alarm "some message" "%i ";
> 
> The intended audience for this use-case is business users and analysts with
> basic SQL skill set.
> 
> Thanks,
> 
> Shirshendu Chakrabarti

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