PMFETCHARCHIVE(3)
π PMFETCHARCHIVE(3) π β Library Functions Manual
okay bestie, sit down, hydrate, and let's talk about pmFetchArchive and pmFetchHighResArchive β two lil functions whose entire job is getting performance metric values directly from archives. yes, straight out of the archive, no middleman. slay. π
β¨ NAME β¨
pmFetchArchive, pmFetchHighResArchive β get performance metric values directly from archives. π¦
β¨ C SYNOPSIS β¨
#include <pcp/pmapi.h>
int pmFetchArchive(pmResult **result);
int pmFetchHighResArchive(pmHighResResult **result);
cc ... -lpcp
β¨ DESCRIPTION β¨
so pmFetchArchive and pmFetchHighResArchive are literally variants of the pmFetch(3) and pmFetchHighRes(3) interfaces, but with one big rule: you can only use them when the current Performance Metrics Application Programming Interface (PMAPI) context is associated with a set of archives. no archive context? no vibes. it's giving "read the room." π
the result gets instantiated with all of the metrics (and instances) from the next archive record. so there's no notion of a list of desired metrics β like, none β and the instance profile of the PMAPI context is ignored. we don't ask, we just take everything. periodt. π
now, plot twist π«Ά: both pmFetchArchive and pmFetchHighResArchive may return a result in which numpmid is zero. that's a <mark> record, and it means there's a temporal discontinuity in the time series of performance metrics. dramatic, i know. this can happen at the boundary between archives in a set, or if the archive associated with the current PMAPI context was created using pmlogextract(1) to concatenate two or more PCP archives β in that case the <mark> record marks a point in time between the end of one input archive and the start of the next input archive. it's the little gap between eras, bestie. β
the expectation is that pmFetchArchive and pmFetchHighResArchive get used to create utilities that scan sets of archives, while the more common access to the archives would be via the pmFetch and pmFetchHighRes interfaces. different tools, different jobs. iykyk. π
want to skip records within the set of archives? okay so use pmSetMode(3) or pmSetModeHighRes(3) to change the collection time within the current PMAPI context, then call either pmFetchArchive or pmFetchHighResArchive. that's it, that's the move. πΈ
π¨ bestie, LISTEN. the result returned by bothpmFetchArchiveandpmFetchHighResArchiveis dynamically allocated, and it must be released using eitherpmFreeResult(3)orpmFreeHighResResult(3)β but notfree(3). notfree(3). i'm so serious. do not do it. π
if you want further details, go peek at pmFetch(3), pmFetchHighRes(3), pmFreeResult(3) and pmFreeHighResResult(3). they have the lore. π
also, both pmFetchArchive and pmFetchHighResArchive return zero on success. zero is the good number here. π
β¨ DIAGNOSTICS β¨
PM_ERR_NOTARCHIVEβ the current PMAPI context is not associated with a set of archives. (yeah. that's the one. the archive-less crime.) π
β¨ SEE ALSO β¨
PMAPI(3), pmFetchHighRes(3), pmSetModeHighRes(3), pmFreeHighResResult(3), pmFetch(3), pmFreeResult(3), pmNewContext(3), pmSetMode(3) and pmTrimNameSpace(3). π
and that's the whole page, bestie!! π«Ά this lil manual page came to you from Performance Co-Pilot / PCP β the PMFETCHARCHIVE(3) era β and honestly? iconic. go read your archives, free your results properly, and stay hydrated. mwah. πβ¨π
π¦ 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) 2016,2022 Red Hat
- 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