DOKK / manpages / debian 10 / libpcp3-dev / pmiputlabel.3.en
PMIPUTLABEL(3) Library Functions Manual PMIPUTLABEL(3)

pmiPutLabel - add labels to the output archive

#include <pcp/pmapi.h>
#include <pcp/import.h>


int pmiPutLabel(unsigned int type, unsigned int id, unsigned int instance, const char *name, const char *value)


cc ... -lpcp_import -lpcp

use PCP::LogImport;

pmiPutLabel($type, $id, $instance, $name, $value);

As part of the Performance Co-Pilot Log Import API (see LOGIMPORT(3)), pmiPutLabel adds a label for the global context or for a given domain, cluster, item, instance domain or instance.

The type must be one of PM_LABEL_CONTEXT, PM_LABEL_DOMAIN, PM_LABEL_CLUSTER, PM_LABEL_ITEM, PM_LABEL_INDOM, or PM_LABEL_INSTANCES.

If type is PM_LABEL_CONTEXT, then id and instance are ignored. Otherwise, id should match a domain, cluster, metric or instance domain defined earlier in a call to pmiAddMetric(3).

If type is PM_LABEL_INSTANCES, then instance should match an instance number of the selected domain. Otherwise instance is ignored.

name is a string containing the name of the label to be added.

value is a string containing the value of the label to be added.

No data will be written until pmiWrite(3) is called, so multiple calls to pmiPutLabel are typically used to accumulate several labels before calling pmiWrite(3).

pmiPutLabel returns zero on success else a negative value that can be turned into an error message by calling pmiErrStr(3).

LOGIMPORT(3), pmiAddInstance(3), pmiAddMetric(3), pmiErrStr(3), pmiPutResult(3), pmiPutValue(3), pmiPutValueHandle(3), pmiPutText(3) and pmiWrite(3).

Performance Co-Pilot