1PMTRIMNAMESPACE(3) Library Functions Manual PMTRIMNAMESPACE(3)
2
3
4
6 pmTrimNameSpace - prune a performance metrics name space
7
9 #include <pcp/pmapi.h>
10
11 int pmTrimNameSpace()
12
13 cc ... -lpcp
14
16 If the current Performance Metrics Application Programming Interface
17 (PMAPI) context corresponds to a version 1 archive log of Performance
18 Co-Pilot (PCP) performance metrics (as collected by pmlogger(1) -V1),
19 then the currently loaded Performance Metrics Name Space (PMNS), is
20 trimmed to exclude metrics for which no description can be found in the
21 archive. The PMNS is further trimmed to remove empty subtrees that do
22 not contain any performance metric.
23
24 Since PCP archives usually contain some subset of all metrics named in
25 the default PMNS, pmTrimNameSpace effectively trims the application's
26 PMNS to contain only the names of the metrics in the archive.
27
28 Since PCP 2.0, pmTrimNameSpace is only needed for dealing with version
29 1 archives. Version 2 archives actually store the "trimmed" PMNS.
30
31 Prior to any trimming, the PMNS is restored to the state as of the com‐
32 pletion of the last pmLoadASCIINameSpace(3) or pmLoadNameSpace(3) or
33 implicit load (in the case of a host with a version 1 Performance Met‐
34 ric Collector Daemon (PMCD)) operation, so the effects of consecutive
35 calls to pmTrimNameSpace with archive contexts are not additive.
36
37 If the current PMAPI context corresponds to a host, rather than an ar‐
38 chive, and the host has a version 1 pmcd or a pmLoadASCIINameSpace(3)
39 or pmLoadNameSpace(3) call was made, then the PMNS reverts to all names
40 loaded into the PMNS at the completion of the last pmLoadASCIINameS‐
41 pace(3) or pmLoadNameSpace(3) or implicit load operation, i.e. any
42 trimming is undone.
43
44 On success, pmTrimNameSpace returns zero.
45
47 pmlogger(1), PMAPI(3), pmLoadASCIINameSpace(3), pmLoadNameSpace(3),
48 pmNewContext(3) and pmns(4).
49
51 PM_ERR_NOPMNS
52 you must have loaded a PMNS using pmLoadASCIINameSpace(3) or
53 pmLoadNameSpace(3) before calling pmTrimNameSpace
54
55 PM_ERR_NOCONTEXT
56 the current PMAPI context is invalid
57
58
59
60Performance Co-Pilot SGI PMTRIMNAMESPACE(3)