pcp
[Top] [All Lists]

Re: Derived metric config file error reporting

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: Re: Derived metric config file error reporting
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Wed, 15 Jun 2016 10:55:02 +0300
Cc: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <5730DE9D.6080103@xxxxxxxxxx>
Organization: Red Hat
References: <5730DE9D.6080103@xxxxxxxxxx>
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0
Hi,

Any thoughts about this?

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

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