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
|