PMIUNITS(3)
β¨ pmiUnits, pmiExtraUnits, pmiID, pmiInDom β¨
okay bestie, welcome to PMIUNITS(3) from the Library Functions Manual π this is the page where we build the little data structures that hold metric identity and units, and honestly? it's giving "glue code but make it iconic" π«Ά
πΈ NAME πΈ
pmiUnits, pmiExtraUnits, pmiID, pmiInDom β construct core metric data structures π
π C SYNOPSIS π
no cap, this is the C side of things, and you're gonna want these headers:
#include <pcp/pmapi.h>
#include <pcp/import.h>
pmID pmiID(int domain, int cluster, int item);
pmInDom pmiInDom(int domain, int serial);
pmUnits pmiUnits(int dimSpace, int dimTime, int dimCount,
unsigned int scaleSpace, unsigned int scaleTime,
unsigned int scaleCount);
pmUnits pmiExtraUnits(int dimSpace, int dimTime, int dimCount,
unsigned int scaleSpace, unsigned int scaleTime,
unsigned int scaleCount, int extraUnit,
unsigned int extraScale);
and when you link it, literally do this:
cc ... -lpcp_import -lpcp
π¦ Perl SYNOPSIS π¦
yes queen, there's a Perl binding, she's cute:
use PCP::LogImport;
$pmid = pmiID($domain, $cluster, $item);
$indom = pmiInDom($domain, $serial);
$units = pmiUnits($dimSpace, $dimTime, $dimCount, $scaleSpace,
$scaleTime, $scaleCount);
$units = pmiExtraUnits($dimSpace, $dimTime, $dimCount, $scaleSpace,
$scaleTime, $scaleCount, $extraUnit,
$extraScale);
π Python SYNOPSIS π
and Python said "not me being left out" π so here she is:
from pcp import pmi
pmid = pmi.pmiLogImport.pmiID(domain, cluster, item)
indom = pmi.pmiLogImport.pmiInDom(domain, serial)
units = pmi.pmiLogImport.pmiUnits(dim_space, dim_time, dim_count,
scale_space, scale_time, scale_count)
π DESCRIPTION π
so. this whole crew lives inside the Performance Co-Pilot Log Import API (go read LOGIMPORT(3) bestie, it's the lore π). these routines are your convenience methods β and lowkey that "especially for script use" energy is real, they were made for scripting β for constructing pmID, pmInDom and pmUnits structures respectively. then you take those and feed them into subsequent calls to pmiAddMetric(3) and pmiAddInstance(3). that's the whole pipeline, periodt β¨
now for the units part, and listen: if you want the complete description of what the components of a pmUnits structure actually mean β the values, the semantics, all of it β go read pmLookupDesc(3). and because that page defines what those components mean, it also defines the valid argument values for pmiUnits and pmiExtraUnits. so like, if you're guessing at dims and scales without reading it? don't. π«Ά
π SEE ALSO π
and that's the page, bestie π this one's brought to you by Performance Co-Pilot a.k.a. PCP, and yes it's still filed under PMIUNITS(3) β now go forth and construct your structures, you've got this πβ¨π
π¦ 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
- Copyright (c) 2012 Red Hat
- Copyright (c) 2010 Ken McDonell. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms