pcp
[Top] [All Lists]

Derived metric config file error reporting

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: Derived metric config file error reporting
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Mon, 9 May 2016 22:01:49 +0300
Cc: Mark Goodwin <mgoodwin@xxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
Organization: Red Hat
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0
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>
  • Derived metric config file error reporting, Marko Myllynen <=