PMDASTORE(3)

πŸ“¦
version 7.2.2 Β· 3 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– PMDASTORE(3) πŸ’–

okay bestie, welcome to pmdaStore β€” page 3 of the Library Functions Manual, PCP edition. she's a lil function, she's got one job, and honestly? she's mostly just standing there looking cute. let's get into it 🫢


✨ NAME ✨

pmdaStore β€” store a value into a metric for a PMDA

like, put a number into a metric. that's the whole vibe. πŸŽ€


🌸 C SYNOPSIS 🌸

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

int pmdaStore(pmResult *result, pmdaExt *pmda);

cc ... -lpcp_pmda -lpcp

two includes, one function, one link line. no cap, that's it. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so, part of the Performance Metrics Domain Agent (PMDA) API (go read PMDA(3) if you haven't, it's the whole lore) β€” pmdaStore is the generic callback for storing a value into a metric. it's the thing that gets called when someone wants to write to a metric, not just read it. main character behavior, lowkey.

but here's the tea: pmdaStore is usually a no-op, because by default no metrics can be altered. like, she's there, she's present, she's not doing anything. iconic of her tbh. πŸ™ˆ

and even if you do write a store callback that lets metrics be altered by pmstore(1)? that implementation is very application dependent. there's no universal recipe, bestie. it's giving "you're on your own, but with love." πŸ’€


πŸ‘‘ CAVEAT πŸ‘‘

⚠️ the PMDA must be using PMDA_INTERFACE_2 or later, as specified in the call to pmdaDSO(3) or pmdaDaemon(3). don't skip this. fr fr. if you're on an older interface, this whole thing is not gonna work and that's on periodt. 😭

πŸ’€ DIAGNOSTICS πŸ’€

pmdaStore returns PM_ERR_PERMISSION to indicate that no metrics may be modified.

so if you see that error, it's not a bug, it's the function politely telling you "bestie no, we don't do that here." πŸš«πŸ’–


🌈 SEE ALSO 🌈

go read them, they're all connected, iykyk 🧚✨


and that's the page!! brought to you by Performance Co-Pilot, aka PCP β€” the source and version you can thank for all of this. mwah, slay, go store a value (or don't, she's a no-op, remember?) πŸ’œπŸ“

πŸ“¦ where this page comes from