PMIPUTVALUE(3)
π pmiPutValue β the add a value for a metric-instance pair moment π
okay bestie, this one's from the Performance Co-Pilot library functions manual, section 3, and it's genuinely so useful. let's get into it π«Ά
β¨ NAME β¨
pmiPutValue β add a value for a metric-instance pair π
πΈ C SYNOPSIS πΈ
#include <pcp/pmapi.h>
#include <pcp/import.h>
int pmiPutValue(const char *name, const char *instance,
const char *value);
cc ... -lpcp_import -lpcp
π Perl SYNOPSIS π
use PCP::LogImport;
pmiPutValue($name, $instance, $value);
π¦ Python SYNOPSIS π¦
from pcp import pmi
log.pmiPutValue(name, instance, value)
π DESCRIPTION π
so, like, as part of the Performance Co-Pilot Log Import API (peep LOGIMPORT(3) for the full lore), pmiPutValue adds a single value to the current output record for a given metric and instance. one value. that's the whole job. iconic. β¨
the metric's name should match one you already defined earlier in a call to pmiAddMetric(3). no defining it later, bestie, it has to exist first. π
now for singular metrics β those lil guys defined with an instance domain of PM_INDOM_NULL β the instance should be NULL or an empty string. periodt. otherwise, instance should match the name of an instance you defined earlier in a call to pmiAddInstance(3) for that metric's instance domain. so yes, the instance has to already exist too. π
and the value? it should be in a format consistent with the metric's type as defined in the call to pmiAddMetric(3). match the vibe of the type, basically. π―
β οΈ heads up bestie: no data will be written until pmiWrite(3) is called. none. zero. it just sits there. π
so because of that, multiple calls to pmiPutValue or pmiPutValueHandle(3) are typically used to accumulate data values for several metric-instance pairs before calling pmiWrite(3). stack 'em up, then flush. that's the flow. π«Ά
π DIAGNOSTICS π
pmiPutValue returns zero on success π β otherwise it returns a negative value that can be turned into an error message by calling pmiErrStr(3). so if you get a negative, go ask pmiErrStr(3) what's up. it'll tell you. π
π SEE ALSO π
LOGIMPORT(3), pmiAddInstance(3), pmiAddMetric(3), pmiErrStr(3), pmiPutResult(3), pmiPutValueHandle(3), pmiPutText(3), pmiPutLabel(3) and pmiWrite(3).
okay that's the whole page, bestie, you ate that π this was Performance Co-Pilot, PMIPUTVALUE(3) β go forth and put some values πβ¨
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2010 Ken McDonell. All Rights Reserved
- Copyright (c) 2018 Red Hat
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms