pcp
[Top] [All Lists]

Re: [pcp] Derived metric config file error reporting

To: Marko Myllynen <myllynen@xxxxxxxxxx>
Subject: Re: [pcp] Derived metric config file error reporting
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Wed, 15 Jun 2016 21:53:20 -0400 (EDT)
Cc: pcp developers <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <576109D6.607@xxxxxxxxxx>
References: <5730DE9D.6080103@xxxxxxxxxx> <576109D6.607@xxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: rUF69jiIlwetfEAyR5lEUoFEfxW4TA==
Thread-topic: Derived metric config file error reporting

----- Original Message -----
> Hi,
> 
> Any thoughts about this?
> 

I think that's a definite "maybe" on both.  :)  Itchy?  Scratch it.

> Thanks,
> 
> On 2016-05-09 22:01, Marko Myllynen wrote:
> > Hi,
> > 
> > $ cat drv.conf
> > # comment line
> > 
> > bad_in_pkts= network.interface.in.errors + network.interface.in.drops
> > 
> > disk.dev.read_pct = 100 * delta(disk.dev.read) / (delta(disk.dev.read) +
> > delta(disk.dev.write))
> > 
> > # another comment
> > $ PCP_DERIVED_CONFIG=./drv.conf pmrep -e ./drv.conf -s 1 bad_in_pkts
> > [./drv.conf:3] Error: pmRegisterDerived(bad_in_pkts, ...) syntax error
> >  network.interface.in.errors + network.interface.in.drops
> >  ^
> > Duplicate derived metric name
> > [./drv.conf:5] Error: pmRegisterDerived(disk.dev.read_pct, ...) syntax
> > error
> >  100 * delta(disk.dev.read) / (delta(disk.dev.read) +
> >  delta(disk.dev.write))
> >  ^
> > Duplicate derived metric name
> >   bad_in_pkts  bad_in_pkts  bad_in_pkts  bad_in_pkts  bad_in_pkts
> >   bad_in_pkts  bad_in_pkts  bad_in_pkts
> >            lo   virbr0-nic       virbr0        vnet0         tun0
> >            vnet1        vnet2        wlan0
> >       count/s      count/s      count/s      count/s      count/s
> >       count/s      count/s      count/s
> >           N/A          N/A          N/A          N/A          N/A
> >           N/A          N/A          N/A
> > $
> > 
> > Two questions here:
> > 
> > 1) Wouldn't it be clearer if the complete formula would be printed
> > after the line which now says "syntax error"?
> > 
> > 2) Would it make sense to have libpcp to skip duplicated derived
> > config files, it might things easier e.g. when scripting? I can't
> > imagine any valid use case when it would be meaningful to allow
> > using the same file twice (as it leads to syntax errors as seen
> > above).
> > 
> > Thanks,
> > 
> 
> 
> --
> Marko Myllynen
> 
> _______________________________________________
> pcp mailing list
> pcp@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/pcp
> 

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