1PMFETCHARCHIVE(3)          Library Functions Manual          PMFETCHARCHIVE(3)
2
3
4

NAME

6       pmFetchArchive - get performance metrics directly from an archive log
7

C SYNOPSIS

9       #include <pcp/pmapi.h>
10
11       int pmFetchArchive(pmResult **result);
12
13       cc ... -lpcp
14

DESCRIPTION

16       pmFetchArchive  is  a  variant of pmFetch(3) that may only be used when
17       the  current  Performance  Metrics  Application  Programming  Interface
18       (PMAPI) context is associated with an archive log.
19
20       The result is instantiated with all of the metrics (and instances) from
21       the next archive record, consequently there is no notion of a  list  of
22       desired  metrics,  and  the  instance  profile  of the PMAPI context is
23       ignored.
24
25       pmFetchArchive may return a result in which numpmid is zero.  This is a
26       <mark>  record  that  indicates  a  temporal  discontinuity in the time
27       series of performance metrics.  This can  happen  if  the  archive  log
28       associated  with  the  current PMAPI context was created using pmlogex‐
29       tract(1) to concatenate two or more PCP archive logs,  and  the  <mark>
30       record  marks  a point in time between the end of one input archive and
31       the start of the next input archive.
32
33       It is expected that pmFetchArchive would be used  to  create  utilities
34       that  scan  archive  logs, while the more common access to the archives
35       would be via the pmFetch(3) interface.
36
37       To skip records within the archive log, use pmSetMode(3) to change  the
38       collection   time   within   the   current  PMAPI  context,  then  call
39       pmFetchArchive.
40
41       Note that the result returned by pmFetchArchive  is  dynamically  allo‐
42       cated,  and  must  be released using pmFreeResult(3), not free(3).  See
43       pmFetch(3) and pmFreeResult(3) for further details.
44
45       pmFetchArchive returns zero on success.
46

SEE ALSO

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

DIAGNOSTICS

52       PM_ERR_NOTARCHIVE
53              the current PMAPI context is not associated with an archive log
54
55
56
57Performance Co-Pilot                  PCP                    PMFETCHARCHIVE(3)
Impressum