1PMFETCHARCHIVE(3) Library Functions Manual PMFETCHARCHIVE(3)
2
3
4
6 pmFetchArchive - get performance metrics directly from a set if archive
7 logs
8
10 #include <pcp/pmapi.h>
11
12 int pmFetchArchive(pmResult **result);
13
14 cc ... -lpcp
15
17 pmFetchArchive is a variant of pmFetch(3) that may only be used when
18 the current Performance Metrics Application Programming Interface
19 (PMAPI) context is associated with a set of archive logs.
20
21 The result is instantiated with all of the metrics (and instances) from
22 the next archive record, consequently there is no notion of a list of
23 desired metrics, and the instance profile of the PMAPI context is
24 ignored.
25
26 pmFetchArchive may return a result in which numpmid is zero. This is a
27 <mark> record that indicates a temporal discontinuity in the time
28 series of performance metrics. This can happen at the boundary between
29 archive logs in a set or if the archive log associated with the current
30 PMAPI context was created using pmlogextract(1) to concatenate two or
31 more PCP archive logs, and the <mark> record marks a point in time
32 between the end of one input archive and the start of the next input
33 archive.
34
35 It is expected that pmFetchArchive would be used to create utilities
36 that scan sets of archive logs, while the more common access to the ar‐
37 chives would be via the pmFetch(3) interface.
38
39 To skip records within the set of archive logs, use pmSetMode(3) to
40 change the collection time within the current PMAPI context, then call
41 pmFetchArchive.
42
43 Note that the result returned by pmFetchArchive is dynamically allo‐
44 cated, and must be released using pmFreeResult(3), not free(3). See
45 pmFetch(3) and pmFreeResult(3) for further details.
46
47 pmFetchArchive returns zero on success.
48
50 PMAPI(3), pmFetch(3), pmFreeResult(3), pmNewContext(3), pmSetMode(3)
51 and pmTrimNameSpace(3).
52
54 PM_ERR_NOTARCHIVE
55 the current PMAPI context is not associated with a set of ar‐
56 chive logs
57
58
59
60Performance Co-Pilot PCP PMFETCHARCHIVE(3)