PMSTORE(3)
π PMSTORE(3) β the modify your metrics page, bestie π
okay so welcome to pmStore, straight out of the Library Functions Manual β¨ this is the one where you get to change the values of performance metrics and honestly? iconic.
πΈ NAME πΈ
pmStore β modify values of performance metrics π
β¨ C SYNOPSIS β¨
#include <pcp/pmapi.h>
int pmStore(const pmResult *result);
cc ... -lpcp
like yes that's the whole vibe, short and slay π
π¦ DESCRIPTION π¦
so. in some special cases it may be helpful to modify the current values of performance metrics, okay? like resetting a counter to zero, or changing a βmetricβ that's actually a control variable for some agent out there collecting performance metrics. it's giving main character energy for control freaks (affectionate) π
pmStore is literally a lightweight inverse of pmFetch(3). no cap. π₯
you, the caller, have to build the result data structure yourself β and yeah, of course it could have been handed to you by an earlier pmFetch(3) call, that's totally valid π
β οΈ it is an error to pass aresulttopmStorewhere thenumvalfield inside any of thepmValueSetstructures has a value less than one. not a vibe. don't do it. π
the current Performance Metrics Application Programming Interface (PMAPI) context has to be one with a host as the source of metrics, and the current value of the nominated metrics will get changed. which means β and this is the important part bestie β pmStore 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, sorry π°οΈπ
the return code from pmStore is zero for success β¨ periodt.
π DIAGNOSTICS π
PM_ERR_GENERICβ at least one of the modifications was rejected. and here's the tea: no other status is available from below the PMAPI (this is the lightweight part of the functionality!). so if the outcome of storing into individual metrics actually matters to you, the caller should make one call to eitherpmStorefor each metric. on the other hand, if you're in a situation where the outcome is not critical, a bulk modification can be performed in a single call π«ΆPM_ERR_NOTHOSTβ the current PMAPI context is an archive rather than a host, or it's a host that is not set to the current time, i.e. it's been βrewoundβ to the recent past usingpmSetMode(3). rewound?? not the time machine arc πPM_ERR_TOOSMALLβ the number of metrics specified inresultis less than one. zero metrics is not a moment, it's an error πPM_ERR_VALUEβ one or more of thepmValueSets inresulthas anumvalfield with a value less than one π
π COMPATIBILITY π
okay history lesson, stay with me π§
prior to PCP 7.0, the timestamp field in the pmResult struct was a struct timeval. to support PMAPI transition, the old interface and semantics can still be used if applications are recompiled with -DPMAPI_VERSION=2 β¨
and for a time in PCP 6.x there was a routine with the same semantics as the current pmStore called pmStoreHighRes, plus a struct with the same definition as the current pmResult struct called pmResultHighRes. however π both are now deprecated, and compile-time support for pmStoreHighRes and pmResultHighRes will be removed in a future release. so like, don't get attached bestie π₯²
π SEE ALSO π
and that's the whole page, bestie π«Ά this gem came to you from Performance Co-Pilot β that's the PCP crew β and yeah, the page is literally named PMSTORE(3) so you'll always know where to find it π bye ily, go reset a counter responsibly β¨ππ¦
π¦ 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
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-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.1.0-6.fc44 Β· 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 resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- 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