Afraid not Dave.
The derived metric expressions are limited to simple arithmetic (albeit
over set-valued operands) and a handful of set -> unary value functions
- avg(), count(), max(), min(), sum(), delta().
On Tue, 2010-05-04 at 13:41 -0500, David Wright wrote:
> Ken,
>
> Can I use a conditional like
>
> if (tcp_opens < 1) then tcp_opens=0
> >
> > As Jason suggests, man pmRegisterDerived is a good place to start.
> >
> > Here is a small illustration by example, also.
> >
> > $ cat $HOME/.pcp/derived
> > tcp_opens = network.tcp.activeopens + network.tcp.passiveopens
> > disk.dev.read_pct = 100 * delta(disk.dev.read) / (delta(disk.dev.read) +
> > delta(disk.dev.write))
> >
> > $ export PCP_DERIVED_CONFIG=$HOME/.pcp/derived
> >
> > $ pminfo -md disk.dev.read disk.dev.read_pct
> >
> > disk.dev.read PMID: 60.0.4
> > Data Type: 32-bit unsigned int InDom: 60.1 0xf000001
> > Semantics: counter Units: count
> >
> > disk.dev.read_pct PMID: 511.0.2
> > Data Type: double InDom: 60.1 0xf000001
> > Semantics: instant Units: none
> >
> > $ pmval tcp_opens
> >
> > metric: tcp_opens
> > host: localhost
> > semantics: cumulative counter (converting to rate)
> > units: count (converting to count / sec)
> > samples: all
> > 0.0
> > 0.9997
> > 0.0
> > ...
> >
> > Launch pmchart and you'll find disk.dev.read_pct right in the middle of
> > the other disk.dev.* metrics in the metric selector.
> > ...
|