PMDAEVENTCLIENT(3)
π PMDAEVENTCLIENT π
okay bestie, welcome to PMDAEVENTCLIENT(3) β the part of the Performance Co-Pilot library manual that's literally all about client context tracking interfaces for event queues. yes, we're doing event queues today. put your hair up, hydrate, let's go π«Ά
β¨ C SYNOPSIS β¨
#include <pcp/pmapi.h>
#include <pcp/pmda.h>
int pmdaEventNewClient(int context);
int pmdaEventEndClient(int context);
int pmdaEventClients(pmAtomValue *avp);
cc ... -lpcp_pmda -lpcp
three little functions. three. and they carry the whole "who's still listening to me" situation on their backs. iconic honestly. π
πΈ DESCRIPTION πΈ
so. picture this. a Performance Metrics Domain Agent (a PMDA, if we're being casual) that exports event records. it needs to know which clients are connected to it, because that's the only way it can track which events have already been sent to which clients so far. no cap.
and here's the part that actually matters: only once an event has been sent to every single monitoring tool that registered an interest can that event be discarded and its memory reclaimed. the event has to be seen by everybody before it can leave the group chat. it's giving β¨closureβ¨.
the PMDA(3) library gives PMDA developers callback routines so they can provide custom handling of client connections and disconnections. cute, right? but here's the fine print bestie β if your PMDA is making use of the event queuing mechanism that pmdaEventNewQueue(3) and friends hand you, then client connections and disconnections must be tracked via calls to pmdaEventNewClient and pmdaEventEndClient respectively. not "should". must. periodt.
why? because that's how the library keeps track of when events can be discarded from a queue β for example, for the context you specified. and that context parameter?
- it gets passed into the
e_endCallBackfunction directly, straight up, no middleman - for the other callback functions, it's available via the
e_contextfield of thepmdaExtstructure - and you can also query it at any time using
pmdaGetContext(3)π
sometimes a PMDA wants to be extra and export a metric showing the current count of attached clients. honestly? valid. that's what the pmdaEventClients routine is for β it fills in the avp pmAtomValue structure on behalf of a PMDA fetch callback routine. it does the paperwork so your fetch callback doesn't have to. slay. π
π₯ SEE ALSO π₯
go read those too bestie, i'm not gatekeeping anything π
this page came to you courtesy of Performance Co-Pilot (that's PCP π) and it lives under PMDAEVENTCLIENT(3). now go track those clients. your queue believes in you. 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
- 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) 2013 Red Hat
- Copyright (c) 2011 Nathan Scott. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms