1LOGIMPORT(3) Library Functions Manual LOGIMPORT(3)
2
3
4
6 LOGIMPORT - introduction to the library for importing data and creating
7 a PCP archive
8
10 #include <pcp/pmapi.h>
11 #include <pcp/import.h>
12
13 cc ... -lpcp_import -lpcp
14
16 use PCP::LogImport;
17
19 The Performance Co-Pilot Log Import (LOGIMPORT) API is a library (and
20 Perl wrapper) that supports the creation of PCP archives from external
21 sources of performance data, either in the form of historical logs and
22 spreadsheets or from real-time sources that are not integrated as a
23 Performance Metrics Domain Agent (PMDA) under the control of pmcd(1).
24
25 The typical usage for LOGIMPORT would involve:
26
27 · An initial call to pmiStart(3).
28
29 · Optional calls to pmiSetHostname(3) and/or pmiSetTimezone(3) to set
30 the hostname and timezone for the source of the performance data.
31
32 · One or more calls to pmiAddMetric(3) to define performance metrics.
33
34 · One or more calls to pmiAddInstance(3) to define instances associ‐
35 ated with the metrics.
36
37 · Optional calls to pmiGetHandle(3) to defined convenience handles for
38 metric-instance pairs.
39
40 · A main loop in which performance data is injested and for each sam‐
41 ple time interval, the PCP archive record is constructed by calls to
42 pmiPutValue(3) and/or pmiPutValueHandle(3), followed by a call to
43 pmiWrite(3) to flush all data and any associated new metadata to the
44 PCP archive. Alternatively, pmiPutResult(3) could be used to pack‐
45 age and process all the data for one sample time interval.
46
47 · Once the input source of data has been consumed, calling pmiEnd(3)
48 to complete the PCP archive creation and close all open files.
49
50 If new metrics and/or instances are discovered during the data injes‐
51 tion, these can be added by subsequent calls to pmiAddMetric(3) and/or
52 pmiAddInstance(3), provided all the metrics and instances have been
53 defined before a call to pmiGetHandle(3), pmiPutValue(3)or pmiPutRe‐
54 sult(3) that references those metrics and instances.
55
57 pmcd(1), pmlogger(1), pmiGetHandle(3), pmiAddInstance(3), pmiAddMet‐
58 ric(3), pmiEnd(3), pmiErrStr(3), pmiPutMark(3), pmiPutResult(3),
59 pmiPutValue(3), pmiPutValueHandle(3), pmiSetHostname(3), pmiSetTime‐
60 zone(3), pmiStart(3) and pmiWrite(3).
61
62
63
64Performance Co-Pilot LOGIMPORT(3)