pmfetcharchive(3) — Linux manual page


PMFETCHARCHIVE(3)       Library Functions Manual       PMFETCHARCHIVE(3)

NAME         top

       pmFetchArchive - get performance metrics directly from a set if
       archive logs

C SYNOPSIS         top

       #include <pcp/pmapi.h>

       int pmFetchArchive(pmResult **result);

       cc ... -lpcp

DESCRIPTION         top

       pmFetchArchive is a variant of pmFetch(3) that may only be used
       when the current Performance Metrics Application Programming
       Interface (PMAPI) context is associated with a set of archive

       The result is instantiated with all of the metrics (and
       instances) from the next archive record, consequently there is no
       notion of a list of desired metrics, and the instance profile of
       the PMAPI context is ignored.

       pmFetchArchive may return a result in which numpmid is zero.
       This is a <mark> record that indicates a temporal discontinuity
       in the time series of performance metrics.  This can happen at
       the boundary between archive logs in a set or if the archive log
       associated with the current PMAPI context was created using
       pmlogextract(1) to concatenate two or more PCP archive logs, and
       the <mark> record marks a point in time between the end of one
       input archive and the start of the next input archive.

       It is expected that pmFetchArchive would be used to create
       utilities that scan sets of archive logs, while the more common
       access to the archives would be via the pmFetch(3) interface.

       To skip records within the set of archive logs, use pmSetMode(3)
       to change the collection time within the current PMAPI context,
       then call pmFetchArchive.

       Note that the result returned by pmFetchArchive is dynamically
       allocated, and must be released using pmFreeResult(3), not
       free(3).  See pmFetch(3) and pmFreeResult(3) for further details.

       pmFetchArchive returns zero on success.

DIAGNOSTICS         top

              the current PMAPI context is not associated with a set of
              archive logs

SEE ALSO         top

       PMAPI(3), pmFetch(3), pmFreeResult(3), pmNewContext(3),
       pmSetMode(3) and pmTrimNameSpace(3).

COLOPHON         top

       This page is part of the PCP (Performance Co-Pilot) project.
       Information about the project can be found at 
       ⟨⟩.  If you have a bug report for this manual
       page, send it to  This page was obtained from the
       project's upstream Git repository
       ⟨⟩ on 2021-08-27.
       (At that time, the date of the most recent commit that was found
       in the repository was 2021-08-27.)  If you discover any rendering
       problems in this HTML version of the page, or you believe there
       is a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to

Performance Co-Pilot               PCP                 PMFETCHARCHIVE(3)

Pages that refer to this page: pcpintro(3)pmfetch(3)pmgetarchiveend(3)pmregisterderived(3)pmsetmode(3)