summaryrefslogtreecommitdiff
path: root/man/man3/pmloadderivedconfig.3
blob: 062be54f57c6f2ee5f33b6f56897f932360b9bf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
'\"macro stdmacro
.\"
.\" Copyright (c) 2009 Ken McDonell.  All Rights Reserved.
.\" 
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\" 
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\" 
.\"
.TH PMLOADDERIVEDCONFIG 3 "" "Performance Co-Pilot"
.SH NAME
\f3pmLoadDerivedConfig\f1 \- load derived metric definitions from a file
.SH "C SYNOPSIS"
.ft 3
#include <pcp/pmapi.h>
.sp
int pmLoadDerivedConfig(char *\fIfname\fP);
.sp
cc ... \-lpcp
.ft 1
.SH DESCRIPTION
.PP
Each line of the file
.I fname
is either a comment line (with a ``#'' in the first position of the line)
or the declaration of a derived performance metric, specified as:
.IP * 2n
the name of the derived metric, using the same ``dot notation'' syntax
that is used for PCP performance metrics, see
.BR PCPIntro (1)
and
.BR pmns (5).
.IP * 2n
an equals sign (``='')
.IP * 2n
a valid expression for a derived metric, as described in
.BR pmRegisterDerived (3).
.PP
White space is ignored in the lines.
.PP
For each line containing a derived metric definition,
.BR pmRegisterDerived (3)
is called to register the new derived metric.
.PP
The result from
.B pmLoadDerivedConfig
will be the number of derived metrics loaded from
.I fname
else a value less than zero in the case of an error.
.SH EXAMPLE
.nf
# sample derived metric definitions
bad_in_pkts = network.interface.in.errors + network.interface.in.drops
# note the following would need to be on a single line ...
disk.dev.read_pct = 100 * delta(disk.dev.read) /
            (delta(disk.dev.read) + delta(disk.dev.write))
.fi
.SH SEE ALSO
.BR PCPIntro (1),
.BR PMAPI (3)
and
.BR pmRegisterDerived (3).