введение в библиотеку поддержки агента домена Performance Metrics (introduction to the Performance Metrics Domain Agent support library)
NAMESPACE
Every PMDA has its own unique namespace
using the format defined
in PMNS(5). In summary, the namespace matches the names of the
metrics to the unique identifier. The simple PMDA
defines five
metrics: simple.numfetch, simple.color, simple.time.user,
simple.time.sys and simple.now. The namespace for these metrics
is defined in $PCP_PMDAS_DIR/simple/pmns and is installed as:
simple {
numfetch 253:0:0
color 253:0:1
time
now 253:2:4
}
simple.time {
user 253:1:2
sys 253:1:3
}
The domain number of 253 is obtained from
$PCP_VAR_DIR/pmns/stdpmid. New PMDAs should specify a unique
domain number in this file, and obtain the number during
installation. This allows the domain number to change by
modifying only the file $PCP_VAR_DIR/pmns/stdpmid.
The simple.time and simple.now metrics are defined in separate
clusters to the other metrics which allows a PMDA to support more
than 1024 metrics, as well as grouping similar metrics together.
Therefore, the item numbers for a new cluster may be identical to
the item numbers in other clusters. The simple PMDA
continues to
increment the item numbers to permit direct mapping (see
pmdaInit(3)).
The namespace file should be installed and removed with the agent
using pmnsadd(1) and pmnsdel(1). See the later sections on
INSTALLATION and REMOVAL.
A simple ASCII namespace can be constructed by creating a file
similar to $PCP_PMDAS_DIR/simple/root:
/*
* fake "root" for validating the local PMNS subtree
*/
#include "$PCP_VAR_DIR/pmns/stdpmid"
root { simple }
#include "pmns"
and can be referred to with the -n
option in most PCP tools.