PMIADDINSTANCE(3)
π pmiAddInstance(3) π
okay bestie, welcome to the Library Functions Manual corner of the PCP universe β this one is pmiAddInstance, and it's literally the glow-up step where a new instance gets added to an instance domain inside a LOGIMPORT context. iconic behaviour, honestly. π¦
β¨ NAME β¨
pmiAddInstance β add an element to an instance domain in a LOGIMPORT context. periodt. π
π C SYNOPSIS
#include <pcp/pmapi.h>
#include <pcp/import.h>
int pmiAddInstance(pmInDom indom, const char *instance, int inst);
cc ... -lpcp_import -lpcp
πΈ Perl SYNOPSIS
use PCP::LogImport;
pmiAddInstance($indom, $instance, $inst);
π Python SYNOPSIS
from pcp import pmi
log.pmiAddInstance(indom, instance, instid)
π DESCRIPTION π
so, plot twist, this is all part of the Performance Co-Pilot Log Import API (peep LOGIMPORT(3) for the lore, iykyk). What pmiAddInstance does is add a brand-new element to the instance domain that's identified by indom. slay. β¨
now, indom would normally be built using the pmInDom_build macro β like pmInDom_build(PMI_DOMAIN,0) for the first instance domain in the Performance Metrics Domain PMI_DOMAIN, which is lowkey the default for all meta data that the LOGIMPORT library creates. π
the new instance has to come with both of these, no exceptions bestie:
- an external name β that's
instance - an internal instance identifier β that's
inst
and inst has to be unique across all the instances in the indom instance domain. π«Ά
β οΈ there's a special "uniqueness rule" forinstancethatpmLookupInDom(3)imposes on you, and it's giving strict-parent energy: the external instance name must be unique in the leading non-space characters. so for example, the instance namesfooandfoo barget considered the same by this rule and are not allowed in the same instance domain β butfooandfoobar? those would be allowed. π
once it's defined, that external instance name can be used in calls to pmiGetHandle(3) and/or pmiPutValue(3) alongside the name of a metric that's defined over the same instance domain. main character energy fr fr. π
π DIAGNOSTICS π
pmiAddInstance returns zero on success, and otherwise a negative value β which you can turn into an actual error message by calling pmiErrStr(3). so if things go sideways, that's your girl. π
π SEE ALSO π
LOGIMPORT(3), pmiAddMetric(3), pmiErrStr(3), pmiGetHandle(3), pmiPutValue(3), pmiPutText(3), pmiPutLabel(3) and pmLookupInDom(3). go read them, bestie, they're all part of the same friend group. π§
and that's a wrap!! π this whole thing comes to you from Performance Co-Pilot β yes, the PMIADDINSTANCE(3) source, no cap β so go forth, add your instances, stay unique in your leading non-space characters, and drink some water. mwah. π
β¨π
π¦ 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