PMIPUTVALUEHANDLE(3)

πŸ“¦ version 7.2.2, in arch rolling, fedora 43, fedora 44, ubuntu stonking

πŸ’– PMIPUTVALUEHANDLE β€” bestie, let's talk handles πŸ’–

okay so. pmiPutAtomValueHandle, pmiPutValueHandle β€” add a value for a metric-instance pair via a handle. yes this is a PMIPUTVALUEHANDLE(3) situation, Library Functions Manual core, and we're gonna get through it together. 🫢


✨ C SYNOPSIS ✨

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

int pmiPutAtomValueHandle(int handle, pmAtomValue *atom);
int pmiPutValueHandle(int handle, const char *value);

cc ... -lpcp_import -lpcp

like, you gotta link it or it simply will not slay. periodt. πŸ’…


🌸 Perl SYNOPSIS 🌸

use PCP::LogImport;

pmiPutValueHandle($handle, $value);

πŸ¦‹ Python SYNOPSIS πŸ¦‹

from pcp import pmi

log.pmiPutValueHandle(handle, value)

πŸŽ€ DESCRIPTION πŸŽ€

so this is part of the Performance Co-Pilot Log Import API (see LOGIMPORT(3)), and pmiPutAtomValueHandle + pmiPutValueHandle are the girlies that add a single value to the current output record for a given metric and instance, using the handle that you defined with an earlier call to pmiGetHandle(3). no handle, no entry. that's the rule. ✨

  • With pmiPutAtomValueHandle, the atom passes the binary value directly, using a union of types. it's giving raw. it's giving direct. πŸ’…
  • With pmiPutValueHandle, the value should be in a format consistent with the metric's type as defined back in your call to pmiAddMetric(3). so if you defined it one way, do not show up with something else. vibe check your types, bestie. 😭
and the big one: no data will be written until pmiWrite(3) is called. not one crumb. so multiple calls to pmiPutAtomValueHandle, pmiPutValueHandle, or pmiPutValue(3) are typically used to accumulate data values for several metric-instance pairs before you finally call pmiWrite(3). it's a whole stack-up-and-go situation. 🧚

πŸ’€ DIAGNOSTICS πŸ’€

pmiPutAtomValueHandle and pmiPutValueHandle return zero on success, else a negative value that can be turned into an error message by calling pmiErrStr(3). so if you get a negative, don't spiral β€” just call pmiErrStr(3) and it'll tell you what happened. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

and that's the roster. read them, love them, use them. 🌈


Performance Co-Pilot made this one, and it's tagged PMIPUTVALUEHANDLE(3) β€” go off, you icon. β­πŸ’–

πŸ“¦ where this page comes from