PMDAEVENTQUEUE - Online Linux Manual PageSection : 3
Updated : PCP
Source : Performance Co-Pilot

NAMEpmdaEventNewQueue, pmdaEventNewActiveQueue, pmdaEventQueueHandle, pmdaEventQueueAppend, pmdaEventQueueShutdown, pmdaEventQueueRecords, pmdaEventQueueClients, pmdaEventQueueCounter, pmdaEventQueueBytes, pmdaEventQueueMemory − utilities for PMDAs managing event queues

C SYNOPSIS#include <pcp/pmapi.h> #include <pcp/pmda.h>int pmdaEventNewQueue(const char *name, size_t maxmem);
int pmdaEventNewActiveQueue(const char *name, size_t maxmem, int nclients);
int pmdaEventQueueHandle(const char *name);
int pmdaEventQueueAppend(int handle, void *buffer, size_t bytes, struct timeval *tv);
int pmdaEventQueueShutdown(int handle); typedef int (*pmdaEventDecodeCallBack)(int, void *, int, struct timeval *, void *);
int pmdaEventQueueRecords(int handle, pmAtomValue *avp, int context, pmdaEventDecodeCallBack decoder, void *data);
int pmdaEventQueueClients(int handle, pmAtomValue *avp);
int pmdaEventQueueCounter(int handle, pmAtomValue *avp);
int pmdaEventQueueBytes(int handle, pmAtomValue *avp);
int pmdaEventQueueMemory(int handle, pmAtomValue *avp); cc ... −lpcp_pmda −lpcp

DESCRIPTIONA Performance Metrics Domain Agent (PMDA) that exports event records must effectively act an event multiplexer. Events consumed by the PMDA may have to be forwarded on to any number of monitoring tools (or "client contexts"). These tools may be requesting events at different sampling intervals, and are very unlikely to request an event at the exact moment it arrives at the PMDA, making some form of event buffering and queueing scheme a necessity. Events must be held by the PMDA until either all registered clients have been sent them, or until a memory limit has been reached by the PMDA at which point it must discard older events as new ones arrive. The routines described here are designed to assist the PMDA developer in managing both client contexts and queues of events at a high level. These fit logically above lower level primitives, such as those described in pmdaEventNewArray(3), and shield the average PMDA from the details of directly building event record arrays for individual client contexts. The PMDA registers a new queue of events using either pmdaEventNewQueue or pmdaEventNewActiveQueue. These are passed an identifying name (for diagnostic purposes, and for subsequent lookup by pmdaEventQueueLookup) and maxmem, an upper bound on the memory (in bytes) that can be consumed by events in this queue, before beginning to discard them (resulting in "missed" events for any client that has not kept up). If a queue is dynamically allocated (such that the PMDA may already have clients connected) the pmdaEventNewActiveQueue interface should be used, with the additional numclients parameter indicating the count of active client connections. The return is a negative error code on failure, suitable for decoding by the pmErrStr(3) routine. Any non-negative value indicates success, and provides a handle suitable for passing into the other API routines. For each new event received by the PMDA, the pmdaEventQueueAppend routine should be called, placing that event into the queue identified by handle. The event itself must be contained in the passed in buffer, having bytes length. The timestamp associated with the event (time at which the event occurred) is passed in via the final tv parameter. In the PMDAs specific implementation of its fetch callback, when values for an event metric have been requested, the pmdaEventQueueRecords routine should be used. It is passed the queue handle and the avp pmAtomValue structure to fill with event records, for the client making that fetch request (identified by the context parameter). Finally, the PMDA must also pass in an event decoding routine, which is responsible for decoding the fields of a single event into the individual event parameters of that event. The data parameter is an opaque cookie that can be used to pass situation-specific information into each decoder invocation. Under some situations it is useful for the PMDA to export state about the queues under its control. The accessor routines − pmdaEventQueueClients, pmdaEventQueueCounter, pmdaEventQueueBytes and pmdaEventQueueMemory provide a mechanism for querying a queue by its handle and filling in a pmAtomValue structure that the pmdaFetchCallBack method should return.

SEE ALSOPMAPI(3), PMDA(3), pmdaEventNewClient(3) and pmdaEventNewArray(3).
0
Johanes Gumabo
Data Size   :   12,933 byte
man-pmdaEventQueueAppend.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   4 / 182,220
Visitor ID   :     :  
Visitor IP   :   3.133.120.64   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.