As part of the Performance Metrics Domain Agent (PMDA) API (see
PMDA(3)), pmdaLabel uses the standard PMDA(3) data structures to
return the labels for performance domain, instance domain, metric or
individual instances in "JSONB" format in the given sets data
The type argument determines the interpretation of ident and the
requested form of label, as follows:
when ident is a PMDA domain identifier,
when ident is a metric identifier and labels for the cluster
containing that metric are being requested.
when ident is a metric identifier,
when ident is an instance domain identifier, or
when ident is a metric identifier and labels for all instances of
that metric are being requested.
The label sets pointer must be initialised to NULL before calling
pmdaLabel and space is only to be allocated when labels are present
and returned. In this case, the return code must indicate the number
of label sets that have been allocated. This will only ever be
greater than one in the PM_LABEL_INSTANCES case.
This is one of the few generic callbacks in libpcp_pmda (see PMDA(3))
that is incomplete, requiring a further pmdaLabelCallBack method of
its own. The additional callback should be registered using
pmdaSetLabelCallBack and the pmdaLabelCallBack method has the
int func(pmInDom indom, unsigned int inst, pmLabelSet **set)
The purpose of the pmdaLabelCallBack routine is to return the
label(s) for an individual instance inst of a given instance domain,
indom. Its successful return code differs significantly to
pmdaLabel, as described below.
On success pmdaLabel returns the number of label sets created. This
is usually zero or one, except in the case of PM_LABEL_INSTANCES
where more than one label sets will often be returned, one for each
instance of the requested metric.
By contrast, on success of the pmdaLabelCallBack routine the number
of labels successfully added to the provided labelset pointer must be
returned (and not the total number of label sets).
If labels for the requested entity could not be obtained due to a
catastrophic failure, such as an out of memory condition, these
routines will return a negative error code.
This page is part of the PCP (Performance Co-Pilot) project.
Information about the project can be found at ⟨http://www.pcp.io/⟩.
If you have a bug report for this manual page, send it to
firstname.lastname@example.org. This page was obtained from the project's upstream
Git repository ⟨https://github.com/performancecopilot/pcp.git⟩ on
2020-08-13. (At that time, the date of the most recent commit that
was found in the repository was 2020-08-11.) If you discover any
rendering problems in this HTML version of the page, or you believe
there is a better or more up-to-date source for the page, or you have
corrections or improvements to the information in this COLOPHON
(which is not part of the original manual page), send a mail to
Performance Co-Pilot PCP PMDALABEL(3)