PMSTORE(3)
π PMSTORE(3) β the pmStore and pmStoreHighRes bestie handbook β¨
Library Functions Manual π Performance Co-Pilot
okay so bestie, imagine you could justβ¦ reach into a running metric and change it?? yeah. that's this. it's giving modify values of performance metrics π
β¨ NAME β¨
pmStore, pmStoreHighRes β modify values of performance metrics π¦
πΈ C SYNOPSIS πΈ
#include <pcp/pmapi.h>
int pmStore(const pmResult *result);
int pmStoreHighRes(const pmHighResResult *result);
cc ... -lpcp
copy it exactly, don't get cute with the includes, i'm watching π
π DESCRIPTION π
so like. in some special cases it may be helpful to modify the current values of performance metrics β for example to reset a counter to zero, or to modify a ``metric'' that's a control variable for some agent that's collecting performance metrics. no cap, that's the whole vibe. π₯
The routines pmStore and pmStoreHighRes are lightweight inverses of pmFetch(3) and pmFetchHighRes(3) respectively. inverse girlies β¨
The caller must build the result data structure (of course, this could have been returned from an earlier pmFetch(3) or pmFetchHighRes(3) call). so yes, you're on your own for construction β but hey, maybe you already have one lying around from a fetch. recycling! π
π¨ okay important one: it is an error to pass aresulttopmStoreorpmStoreHighResin which thenumvalfield within any of thepmValueSetstructures has a value less than one. less than one. that's the rule. don't test it. π
The current Performance Metrics Application Programming Interface (PMAPI) context must be one with a host as the source of metrics, and the current value of the nominated metrics will be changed β i.e. pmStore and pmStoreHighRes cannot be used to make retrospective changes to information in either the archives, or in the recent past for real-time sources of metrics. no time travel bestie, sorry π
The return code from pmStore and pmStoreHighRes is zero for success. zero = slay. anything else = read on. π
π©Ί DIAGNOSTICS π©Ί
PM_ERR_GENERICβ at least one of the modifications was rejected. no other status is available from below the PMAPI (this is the lightweight part of the functionality!). in cases where the outcome of storing into individual metrics is important, the caller should make one call to eitherpmStoreorpmStoreHighResfor each metric. on the other hand, a bulk modification can be performed in a single call for situations in which the outcome is not critical. pick your fighter: per-metric accountability or one big chaotic group chat. πPM_ERR_NOTHOSTβ the current PMAPI context is an archive rather than a host, or it is a host that is not set to the current time, i.e. has been ``rewound'' to the recent past usingpmSetMode(3)orpmSetModeHighRes(3). the past is the past, we don't edit it. βͺPM_ERR_TOOSMALLβ the number of metrics specified inresultis less than one. like. zero metrics. what are we even doing here. πPM_ERR_VALUEβ one or more of thepmValueSets inresulthas anumvalfield with a value less than one. (told you it was a rule π )
π«Ά SEE ALSO π«Ά
PMAPI(3), pmFetch(3), pmFetchHighRes(3), pmSetModeHighRes(3) and pmSetMode(3). go read the girlies, they're all connected iykyk πΈ
sign-off time π
this whole thing came from Performance Co-Pilot (PCP), and yeah, the page is literally titled PMSTORE(3) β it's giving main character energy and honestly? deserved. ππ
now go store something. responsibly. β¨π¦π
π¦ where this page comes from
- centos-stream 9: pcp-doc 6.3.7-14.el9 Β· GPL-2.0-or-later AND CC-BY-3.0
- debian trixie: libpcp3-dev 6.3.8-1
- opensuse-leap 16.0: pcp-doc 6.2.0-160000.4.1 Β· GPL-2.0+ AND CC-BY-SA-3.0
- ubuntu noble: libpcp3-dev 6.2.0-1.1build4
- ubuntu questing: libpcp3-dev 6.3.8-1
- Copyright (c) 2022 Red Hat. All Rights Reserved
- Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms