1PMIADDINSTANCE(3) Library Functions Manual PMIADDINSTANCE(3)
2
3
4
6 pmiAddInstance - add an element to an instance domain in a LOGIMPORT
7 context
8
10 #include <pcp/pmapi.h>
11 #include <pcp/import.h>
12
13 int pmiAddInstance(pmInDom indom, const char *instance, int inst);
14
15 cc ... -lpcp_import -lpcp
16
18 use PCP::LogImport;
19
20 pmiAddInstance($indom, $instance, $inst);
21
23 As part of the Performance Co-Pilot Log Import API (see LOGIMPORT(3)),
24 pmiAddInstance adds a new element to the instance domain identified by
25 indom.
26
27 indom would normally be constructed using the pmInDom_build macro, e.g.
28 pmInDom_build(PMI_DOMAIN,0) for the first instance domain in the Per‐
29 formance Metrics Domain PMI_DOMAIN (which is the default for all meta
30 data created by the LOGIMPORT library).
31
32 The new instance must have both an external name (instance) and an
33 internal instance identifier (inst) that is unique across all instances
34 in the indom instance domain. There is a special ``uniqueness rule''
35 for instance that is imposed by pmLookupInDom(3), namely that the
36 external instance name must be unique in the leading non-space charac‐
37 ters, e.g. the instance names ``foo'' and ``foo bar'' are considered
38 the same by this rule and not allowed in the same instance domain, but
39 ``foo'' and ``foobar'' would be allowed.
40
41 Once defined, the external instance name can be used in calls to
42 pmiGetHandle(3) and/or pmiPutValue(3) with the name of a metric defined
43 over the same instance domain.
44
46 pmiAddInstance returns zero on success else a negative value that can
47 be turned into an error message by calling pmiErrStr(3).
48
50 LOGIMPORT(3), pmiAddMetric(3), pmiErrStr(3), pmiGetHandle(3), pmiPut‐
51 Value(3) and pmLookupInDom(3).
52
53
54
55Performance Co-Pilot PMIADDINSTANCE(3)