pcp
[Top] [All Lists]

Re: pcp updates: pmcpp

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Subject: Re: pcp updates: pmcpp
From: fche@xxxxxxxxxx (Frank Ch. Eigler)
Date: Sun, 26 Jul 2015 08:07:58 -0400
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <55B2DEE0.8080809@xxxxxxxxxxxxxxxx> (Ken McDonell's message of "Sat, 25 Jul 2015 10:57:04 +1000")
References: <55B2DEE0.8080809@xxxxxxxxxxxxxxxx>
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)
kenj wrote:

> These commits provide a major upgrade for pmcpp, promoting it from a
> PMNS-helper to a more general purpose pre-processor with include
> file handling, conditional inclusion/exclusion and parameterless
> macro definition and expansion.

(Did you consider using plain /bin/cpp?  But see below.)


> First consumer of this will be pmlogger that will (soon) process all
> configuration files with pmcpp -rs so that pmlogger configuration
> files may be enhanced, e.g. the following will be acceptable ...
>
> %include "commonloggerstuff"
>
> %define _cpu
> %define cpu_interval "30 seconds"
> %define cpu_prefix kernel.all.cpu.
>
> %ifdef _cpu
> log mandatory on %cpu_interval {
>       %{cpu_prefix}user
>       %{cpu_prefix}sys
>       ...
> }
> %endif

These are real nice for abbrevation - anything else?

The sorts of logic I've been hoping for in the pmlogger language are
more sophisticated switching capabilities (more than "probe ..." as
per pmlogconf), for example:

- to exclude non-container-related metrics if running within a
  container

- to vary the configuration according to -run-time- variables like
  other metrics (or pmie expressions), so as to dynamically adjust
  logging intensity according to specified conditions

- enough smarts to express the pmlogconf language directly, so we
  can ditch the super-slow pmlogconf implementation

For such things, it's the "%if $condition" consruct that's key, for
rich enough $condition.


- FChE

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