1QMC_METRIC(3) Library Functions Manual QMC_METRIC(3)
2
3
4
6 QmcMetric - container for a metric and all its values
7
9 #include <pcp/pmc/Metric.h>
10
11 CC ... -lpcp_pmc -lpcp
12
14 A QmcMetric object is a container for a single metric and all its val‐
15 ues.
16
17 The QmcMetricValue structure is used to hold the instance index, values
18 and errors of each instance. In the case of a singular metric, a sin‐
19 gle QmcMetricValue object is used.
20
21 A QmcMetric object consists of a list of QmcMetricValue objects,
22 indexes to the descriptors in the metric's QmcGroup and QmcContext and
23 flags to indicate if the instances are explicit or implicit, and if
24 only active metrics are required after QmcMetric::updateIndom is
25 called.
26
28 Metrics should be constructed through the QmcGroup::addMetric methods
29 as this will ensure that the references to the metric's context,
30 descriptor and instance domain are correctly initialized.
31
33 For metrics with an instance domain it is possible to add and remove
34 any instance, and also update the instance list to reflect changes in a
35 dynamic instance domain.
36
37 bool updateIndom();
38 Update the metric to include new instances. This method will first
39 call QmcContext::update to update the instance domain. If the
40 active flag is set in the QmcGroup::addMetric call, only instances
41 will exported by the metric, otherwise the metric will export all
42 instances listed in the domain.
43
44 The ordering of instances may change as a result of this call.
45 Instances that already existed will keep their current and previous
46 values and errors, even if they are in a different order.
47
48 int addInst(QString const& name);
49 Add the instance name to the metric. If the instance does not
50 exist in the instance domain, a PMAPI(3) error will be returned.
51 This method ignores the value of the active flag set in the QmcMet‐
52 ric constructor.
53
54 void removeInst(uint_t index);
55 Remove the instance at position index from the metric.
56
58 PMAPI(3), QMC(3), QMC_Context(3), QMC_Group(3), pmflush(3) and
59 pmprintf(3).
60
62 Error messages are generated using pmprintf(3) but are not flushed. It
63 is the responsibility of the user to call pmflush(3) to output any mes‐
64 sages.
65
66 Additional diagnostics may be activated by adding DBG_TRACE_PMC to the
67 global pmDebug.
68
69
70
71Performance Co-Pilot SGI QMC_METRIC(3)