1LOGARCHIVE(5)                 File Formats Manual                LOGARCHIVE(5)
2
3
4

NAME

6       LOGARCHIVE - Performance Co-Pilot archive log formats
7

DESCRIPTION

9       Performance Co-Pilot (PCP) archives store historical values about arbi‐
10       trary metrics recorded from a single host.  Archives are machine  inde‐
11       pendent  and self-contained - all metric data and metadata required for
12       off-line or off-site analysis is held within an archive.
13
14       The format is stable in order to allow long-term historical storage and
15       processing  by PMAPI(3) client tools.  However some format variants are
16       supported over time, and currently Versions 2 and 3 are supported.  The
17       mandate  is that PCP will provide long-term backwards compatibility, so
18       an archive created on any version of PCP can be read on that version of
19       PCP  and  all  subsequent  versions of PCP.  The exception is Version 1
20       that was retired in the PCP Version 2.0 release in May 1998.
21
22       Archives may be read by most PCP client tools, using  the  -a/--archive
23       NAME  option, or dumped raw by pmdumplog(1).  Archives are created pri‐
24       marily by pmlogger(1), however they  can  also  be  created  using  the
25       LOGIMPORT(3) programming interface.
26
27       Archives  may  be merged, analyzed, modified and subsampled using pmlo‐
28       greduce(1), pmlogsummary(1), pmlogrewrite(1) and  pmlogextract(1).   In
29       addition, PCP archives may be examined in sets or grouped together into
30       ``archive folios'', which are created and managed by  the  mkaf(1)  and
31       pmafm(1) tools.
32
33       An archive consists of several physical files that share a common arbi‐
34       trary prefix, e.g.  myarchive.
35
36       myarchive.0, myarchive.1, ...
37              One or more data volumes containing the metric  values  and  any
38              error  codes  encountered during metric sampling.  Typically the
39              largest of the files and may grow very rapidly, depending on the
40              selection  of  metrics  to be logged by pmlogger(1) and the sam‐
41              pling intervals being used.
42
43       myarchive.meta
44              Information for PMAPI functions  such  as  pmLookupName(3),  pm‐
45              LookupDesc(3),   pmLookupLabels(3)  and  pmLookupInDom(3).   The
46              metadata file may grow sporadically as logged metrics,  instance
47              domains and labels vary over time.
48
49       myarchive.index
50              A  temporal  index,  mapping  timestamps  to byte offsets in the
51              other files.
52

COMMON FEATURES

54       All three types of files have a similar record-based structure, a  con‐
55       vention  of network byte-order (big-endian) encoding, and 32-bit fields
56       for tagging/padding for those records.  Strings  are  stored  as  8-bit
57       characters  without  assuming  a  specific encoding, so normally ASCII.
58       See also the __pmLog* types in src/include/pcp/libpcp.h.
59
60
61   RECORD FRAMING
62       The volume and .meta files are divided into self-identifying records.
63
64       ┌───────┬────────┬─────────────────────────────────────────────────────┐
65       │Offset │ Length │                        Name                         │
66       ├───────┼────────┼─────────────────────────────────────────────────────┤
67       │     0 │      4 │ N, length of record, in bytes, including this field │
68       │     4 │    N-8 │ record payload, usually starting with a 32-bit      │
69       │       │        │ record type tag                                     │
70       │   N-4 │      4 │ N, length of record (again)                         │
71       └───────┴────────┴─────────────────────────────────────────────────────┘
72
73   ARCHIVE LABEL
74       All  three types of files begin with an ``archive label'' header, which
75       identifies the host name, starting timestamp and timezone  information;
76       all  referring  to the host that was the source of the performance data
77       (which may be different to the host where pmlogger(1) was running).
78
79       The ``archive label'' format differs between Version 2 and  Version  3,
80       with  the  latter providing enhanced timestamps (64-bit encoding of the
81       seconds part and nanosecond precision) and some additional fields.
82
83
84       ┌──────────────────────────────────────────────────────────────────────┐
85       │                              Version 2                               │
86       ├───────┬────────┬─────────────────────────────────────────────────────┤
87       │Offset │ Length │                        Name                         │
88       ├───────┼────────┼─────────────────────────────────────────────────────┤
89       │     0 │      4 │ tag, PM_LOG_MAGIC | PM_LOG_VERS02=0x50052602        │
90       │     4 │      4 │ process id (PID) of pmlogger process that wrote     │
91       │       │        │ file                                                │
92       │     8 │      4 │ archive start time, seconds part (past UNIX epoch)  │
93       │    12 │      4 │ archive start time, microseconds part               │
94       │    16 │      4 │ current archive volume number (or -1=.meta,         │
95       │       │        │ -2=.index)                                          │
96       │    20 │     64 │ name of collection host                             │
97       │    80 │     40 │ time zone string for collection host ($TZ           │
98       │       │        │ environment variable)                               │
99       └───────┴────────┴─────────────────────────────────────────────────────┘
100
101       ┌──────────────────────────────────────────────────────────────────────┐
102       │                              Version 3                               │
103       ├───────┬────────┬─────────────────────────────────────────────────────┤
104       │Offset │ Length │                        Name                         │
105       ├───────┼────────┼─────────────────────────────────────────────────────┤
106       │     0 │      4 │ tag, PM_LOG_MAGIC | PM_LOG_VERS03=0x50052603        │
107       │     4 │      4 │ PID of pmlogger process that wrote file             │
108       │     8 │      8 │ archive start time, seconds part (past UNIX epoch)  │
109       │    16 │      4 │ archive start time, nanoseconds part                │
110       │    20 │      4 │ current archive volume number (or -1=.meta,         │
111       │       │        │ -2=.index)                                          │
112       │    24 │      4 │ archive feature bits                                │
113       │    28 │      4 │ reserved for future use                             │
114       │    32 │    256 │ name of collection host                             │
115       │   288 │    256 │ timezone string for collection host ($TZ            │
116       │       │        │ environment variable), e.g. AEDT-11                 │
117       │   544 │    256 │ timezone zoneinfo string for collection host, e.g.  │
118       │       │        │ :Australia/Melbourne                                │
119       └───────┴────────┴─────────────────────────────────────────────────────┘
120
121       The ``archive feature bits'' are intended  to  encode  possible  future
122       extensions  or  differences to the on-disk structure or the the archive
123       semantics.  At this stage there are no such features, but if  they  are
124       introduced  at  some  point  in  the  future,  there will be associated
125       PM_LOG_FEATURE_XXX macros added to the <pcp/pmapi.h> header file.
126
127
128       All fields, except for the ``current archive volume number'', match for
129       all files in a single PCP archive.
130
131

ARCHIVE VOLUME (.0, .1, ...) RECORDS

133   pmResult
134       After  the archive label record, an archive volume file contains one or
135       more  records,  each  providing  metric  values  corresponding  to  the
136       pmResult  from  one  pmFetch(3)  operation.   The  record size may vary
137       according to  number  of  metrics  being  fetched  and  the  number  of
138       instances in the associated instance domains.
139
140       For  Version  2  the  file  size  is limited to 2GiB, due to storage of
141       32-bit byte offsets within the temporal index.  For Version 3 the  file
142       size  is  limited  to  8191PiB,  due  to storage of 62-bit byte offsets
143       within the temporal index.
144
145       The pmResult format differs between Version 2 and Version 3,  with  the
146       latter  providing  enhanced  timestamps (64-bit encoding of the seconds
147       part and nanosecond precision).
148
149
150           ┌─────────────────────────────────────────────────────────────┐
151           │                         Version 2                           │
152           ├────────┬────────┬───────────────────────────────────────────┤
153           │Offset  │ Length │                   Name                    │
154           ├────────┼────────┼───────────────────────────────────────────┤
155           │      0 │      4 │ timestamp, seconds part (past UNIX epoch) │
156           │      4 │      4 │ timestamp, microseconds part              │
157           │      8 │      4 │ number of metrics with data following     │
158           │     12 │      M │ pmValueSet #0                             │
159           │   12+M │      N │ pmValueSet #1                             │
160           │ 12+M+N │    ... │ ...                                       │
161           │    NOP │      X │ pmValueBlock #0                           │
162           │  NOP+X │      Y │ pmValueBlock #1                           │
163           │NOP+X+Y │    ... │ ...                                       │
164           └────────┴────────┴───────────────────────────────────────────┘
165
166           ┌─────────────────────────────────────────────────────────────┐
167           │                         Version 3                           │
168           ├────────┬────────┬───────────────────────────────────────────┤
169           │Offset  │ Length │                   Name                    │
170           ├────────┼────────┼───────────────────────────────────────────┤
171           │      0 │      8 │ timestamp, seconds part (past UNIX epoch) │
172           │      8 │      4 │ timestamp, nanoseconds part               │
173           │     12 │      4 │ number of metrics with data following     │
174           │     16 │      M │ pmValueSet #0                             │
175           │   16+M │      N │ pmValueSet #1                             │
176           │ 16+M+N │    ... │ ...                                       │
177           │    NOP │      X │ pmValueBlock #0                           │
178           │  NOP+X │      Y │ pmValueBlock #1                           │
179           │NOP+X+Y │    ... │ ...                                       │
180           └────────┴────────┴───────────────────────────────────────────┘
181
182       Records  with  a  ``number  of  metrics''  equal  to  zero  are  ``mark
183       records'',   and   represent   interruptions,  missing  data,  or  time
184       discontinuities in logging.
185
186   pmValueSet
187       This subrecord represents the values for one metric  at  one  point  in
188       time.
189
190         ┌───────┬────────┬────────────────────────────────────────────────┐
191         │Offset │ Length │                      Name                      │
192         ├───────┼────────┼────────────────────────────────────────────────┤
193         │     0 │      4 │ Performance Metrics Identifier (PMID)          │
194         │     4 │      4 │ number of values                               │
195         │     8 │      4 │ value format, PM_VAL_INSITU=0 or PM_VAL_DPTR=1 │
196         │    12 │      M │ pmValue #0                                     │
197         │  12+M │      N │ pmValue #1                                     │
198         │12+M+N │    ... │ ...                                            │
199         └───────┴────────┴────────────────────────────────────────────────┘
200
201       The  metadata  describing  metrics is found in the .meta file where the
202       entries  are  not  timestamped,  as  the  metadata  is  assumed  to  be
203       unchanging throughout an archive.
204
205   pmValue
206       This subrecord represents one value for one instance of a metric at one
207       point in  time.   It  is  a  variant  type,  depending  on  the  parent
208       pmValueSet's  value  format  field.   This  allows  small numbers to be
209       encoded compactly, but retain flexibility for larger or variable length
210       data  to  be  stored  later  in  the  pmResult record in a pmValueBlock
211       subrecord.
212
213       ┌───────┬────────┬─────────────────────────────────────────────────────┐
214       │Offset │ Length │                        Name                         │
215       ├───────┼────────┼─────────────────────────────────────────────────────┤
216       │     0 │      4 │ internal instance identifier (or PM_IN_NULL=-1 for  │
217       │       │        │ singular metrics)                                   │
218       │     4 │      4 │ value (INSITU) or
219       │       │        │ offset in pmResult to our pmValueBlock (DPTR)       │
220       └───────┴────────┴─────────────────────────────────────────────────────┘
221
222       The metadata describing the instance domain for metrics is found in the
223       .meta file.  Since the numeric mappings may change during the  lifetime
224       of  the  logging  session, it is important to match up the timestamp of
225       the measurement record with the corresponding instance  domain  record.
226       That  is,  the instance domain corresponding to a measurement at time T
227       is the instance domain observation for  the  metric's  instance  domain
228       with largest timestamp T' <= T.
229
230
231   pmValueBlock
232       Instances  of  this  subrecord are placed at the end of the pmValueSet,
233       after all the pmValue subrecords.  If (and only if)  needed,  they  are
234       padded at the end to the next 32-bit boundary.
235
236         ┌───────┬────────┬────────────────────────────────────────────────┐
237         │Offset │ Length │                      Name                      │
238         ├───────┼────────┼────────────────────────────────────────────────┤
239         │     0 │      1 │ value type (same as pmDesc.type)               │
240         │     1 │      3 │ 4 + N, the length of the subrecord             │
241         │     4 │      N │ bytes that make up the raw value               │
242         │   4+N │    0-3 │ padding (not included in the 4+N length field) │
243         └───────┴────────┴────────────────────────────────────────────────┘
244
245       Note  that  for  PM_TYPE_STRING,  the  length includes an explicit NULL
246       terminator byte.  For PM_TYPE_EVENT, the value byte string  is  further
247       structured.   Refer to PMDAEVENTARRAY(3) for more information about how
248       arrays of event records are packed inside a pmResult container.
249
250

METADATA FILE (.meta) RECORDS

252       After the archive label record, the metadata file contains  interleaved
253       metric   description  records,  timestamped  instance  domain  records,
254       timestamped label records (for  context,  instance  domain  and  metric
255       labels)  and  (help)  text  records.   Unlike  the  data volumes, these
256       records are not forced to 32-bit alignment.
257
258       For Version 2 the file size is limited  to  2GiB,  due  to  storage  of
259       32-bit  byte offsets within the temporal index.  For Version 3 the file
260       size is limited to 8191PiB, due  to  storage  of  62-bit  byte  offsets
261       within the temporal index.
262
263       See also libpcp/src/logmeta.c.
264
265   Metric Descriptions
266       Instances  of  this  pmDesc) record provide the description or metadata
267       for each metric appearing in the PCP archive.  This  metadata  includes
268       the   metric's   PMID,  data  type,  data  semantics,  instance  domain
269       identifier (or PM_INDOM_NULL for singular metrics with only one  value)
270       and a set of (1 or more) names.
271
272        ┌───────┬────────┬───────────────────────────────────────────────────┐
273        │Offset │ Length │                       Name                        │
274        ├───────┼────────┼───────────────────────────────────────────────────┤
275        │     0 │      4 │ tag, TYPE_DESC=1                                  │
276        │     4 │      4 │ PMID                                              │
277        │     8 │      4 │ data type (PM_TYPE_*)                             │
278        │    12 │      4 │ instance domain identifier                        │
279        │    16 │      4 │ metric semantics (PM_SEM_*)                       │
280        │    20 │      4 │ units: bit-packed pmUnits                         │
281        │     4 │      4 │ number of alternative names for this PMID         │
282        │    28 │      4 │ N: number of bytes in this name                   │
283        │    32 │      N │ bytes of the name, no NULL terminator nor padding │
284        │  32+N │      4 │ N2: number of bytes in next name                  │
285        │  36+N │     N2 │ bytes of the name, no NULL terminator nor padding │
286        │   ... │    ... │ ...                                               │
287        └───────┴────────┴───────────────────────────────────────────────────┘
288
289   Instance Domains
290       A  set-valued metric is defined over an instance domain, which consists
291       of an instance domain identifier (will have already been mentioned in a
292       prior pmDesc record), a count of the number of instances and a map that
293       defines  the  association   between   internal   instance   identifiers
294       (integers) and external instance names (strings).
295
296       Because instance domains can change over time, the instance domain also
297       requires a timestamp, and the same instance domain can  occur  multiple
298       times within the .meta file.  The timestamps are used to search for the
299       temporally correct instance domain when decoding pmResult records  from
300       the  archive  data  volumes,  or answering metadata queries against the
301       instance domain.
302
303       The instance domain format  differs  markedly  between  Version  2  and
304       Version  3.  Version 3 provides enhanced timestamps (64-bit encoding of
305       the seconds  part  and  nanosecond  precision)  and  introduces  a  new
306       ``delta''  instance  domain format that encodes differences between the
307       previous observation of the instance domain and the  current  state  of
308       the instance domain.
309
310
311         ┌──────────────────────────────────────────────────────────────────┐
312         │                Full Instance Domain - Version 2                  │
313         ├─────────┬────────┬───────────────────────────────────────────────┤
314         │ Offset  │ Length │                     Name                      │
315         ├─────────┼────────┼───────────────────────────────────────────────┤
316         │       0 │      4 │ tag, TYPE_INDOM_V2=2                          │
317         │       4 │      4 │ timestamp, seconds part (past UNIX epoch)     │
318         │       8 │      4 │ timestamp, microseconds part                  │
319         │      12 │      4 │ instance domain number                        │
320         │      16 │      4 │ N: number of instances in domain, normally >0 │
321         │      20 │      4 │ first instance number                         │
322         │      24 │      4 │ second instance number (if appropriate)       │
323         │     ... │    ... │ ...                                           │
324         │  20+4*N │      4 │ first offset into string table (see below)    │
325         │20+4*N+4 │      4 │ second offset into string table (etc.)        │
326         │     ... │    ... │ ...                                           │
327         │  20+8*N │      M │ base of string table, containing              │
328         │         │        │ packed, NULL-terminated instance names        │
329         └─────────┴────────┴───────────────────────────────────────────────┘
330
331         ┌──────────────────────────────────────────────────────────────────┐
332         │                Full Instance Domain - Version 3                  │
333         ├─────────┬────────┬───────────────────────────────────────────────┤
334         │ Offset  │ Length │                     Name                      │
335         ├─────────┼────────┼───────────────────────────────────────────────┤
336         │       0 │      4 │ tag, TYPE_INDOM=5                             │
337         │       4 │      8 │ timestamp, seconds part (past UNIX epoch)     │
338         │      12 │      4 │ timestamp, nanoseconds part                   │
339         │      16 │      4 │ instance domain number                        │
340         │      20 │      4 │ N: number of instances in domain, normally >0 │
341         │      24 │      4 │ first instance number                         │
342         │      28 │      4 │ second instance number (if appropriate)       │
343         │     ... │    ... │ ...                                           │
344         │  24+4*N │      4 │ first offset into string table (see below)    │
345         │24+4*N+4 │      4 │ second offset into string table (etc.)        │
346         │     ... │    ... │ ...                                           │
347         │  24+8*N │      M │ base of string table, containing              │
348         │         │        │ packed, NULL-terminated instance names        │
349         └─────────┴────────┴───────────────────────────────────────────────┘
350
351       The  ``delta''  instance  domain  record  in  Version  3  uses the same
352       physical structure as the  ``full''  instance  domain  above  with  the
353       following differences:
354       *  The tag is TYPE_INDOM_DELTA=6.
355       *  The  ``number  of instances in domain'' field becomes the sum of the
356          number of instances added and the number of instances deleted.
357       *  Deleted instances are encoded with the string offset set to  -1  and
358          there is no corresponding string table entry.
359       *  Added instances are encoded exactly the same way.
360
361
362       The  ``delta'' instance domain format is used to provide a more compact
363       on-disk encoding for instance domains  that  have  a  large  number  of
364       instances  and are subject to frequent small changes, e.g. the instance
365       domain of process ids, as exported by pmdaproc(1).
366
367
368       For ``full'' instance domain records the instance  domain  replace  the
369       previous  instance  domain: prior records are not searched for instance
370       domain metadata queries after this timestamp.
371
372
373       Each instance domain in a  Version  3  archive  must  have  an  initial
374       ``full''  instance  domain  record.   Subsequent  records  for the same
375       instance domain can be the  `full''  or  the  ``delta''  variant.   Any
376       instance  mentioned in the prior observation of an instance domain that
377       is not mentioned in the ``delta'' instance domain record is assumed  to
378       continue to exist for the current observation of the instance domain.
379
380
381   Labels for Contexts, Instance Domains and Metrics
382       Instances  of  this  (pmLogLabelSet)  record  provide  sets  of  label-
383       name:label-value pairs associated with labels of the context,  instance
384       domains and individual performance metrics - refer to pmLookupLabels(3)
385       for further details.
386
387       Any instance domain identifier will have already been  mentioned  in  a
388       prior pmDesc record.
389
390       As new labels can appear during an archiving session, these records are
391       timestamped and must be searched when decoding  pmResult  records  from
392       the  archive  data  volumes.   The pmLogLabelSet format differs between
393       Version 2 and Version 3, with the latter providing enhanced  timestamps
394       (64-bit encoding of the seconds part and nanosecond precision).
395
396
397       ┌──────────────────────────────────────────────────────────────────────┐
398       │                              Version 2                               │
399       ├────────────┬────────┬────────────────────────────────────────────────┤
400       │  Offset    │ Length │                      Name                      │
401       ├────────────┼────────┼────────────────────────────────────────────────┤
402       │          0 │      4 │ tag, TYPE_LABEL_V2=3                           │
403       │          4 │      4 │ timestamp, seconds part (past UNIX epoch)      │
404       │          8 │      4 │ timestamp, microseconds part                   │
405       │         12 │      4 │ label type (PM_LABEL_* type macros.)           │
406       │         16 │      4 │ numeric identifier - domain, PMID, etc or      │
407       │            │        │ PM_IN_NULL=-1 for context labels               │
408       │         20 │      4 │ N: number of label sets in this record,        │
409       │            │        │ usually 1 except in the case of instances      │
410       │         24 │      4 │ offset to the start of the JSONB labels string │
411       │         28 │     L1 │ first labelset array entry (see below)         │
412       │        ... │    ... │ ...                                            │
413       │      28+L1 │     LN │ N-th labelset array entry (see below)          │
414       │        ... │    ... │ ...                                            │
415       │28+L1+...LN │      M │ concatenated JSONB strings for all labelsets   │
416       └────────────┴────────┴────────────────────────────────────────────────┘
417
418       ┌──────────────────────────────────────────────────────────────────────┐
419       │                              Version 3                               │
420       ├────────────┬────────┬────────────────────────────────────────────────┤
421       │  Offset    │ Length │                      Name                      │
422       ├────────────┼────────┼────────────────────────────────────────────────┤
423       │          0 │      4 │ tag, TYPE_LABEL=7                              │
424       │          4 │      8 │ timestamp, seconds part (past UNIX epoch)      │
425       │         12 │      4 │ timestamp, nanoseconds part                    │
426       │         16 │      4 │ label type (PM_LABEL_* type macros.)           │
427       │         20 │      4 │ numeric identifier - domain, PMID, etc or      │
428       │            │        │ PM_IN_NULL=-1 for context labels               │
429       │         24 │      4 │ N: number of label sets in this record,        │
430       │            │        │ usually 1 except in the case of instances      │
431       │         28 │      4 │ offset to the start of the JSONB labels string │
432       │         32 │     L1 │ first labelset array entry (see below)         │
433       │        ... │    ... │ ...                                            │
434       │      32+L1 │     LN │ N-th labelset array entry (see below)          │
435       │        ... │    ... │ ...                                            │
436       │32+L1+...LN │      M │ concatenated JSONB strings for all labelsets   │
437       └────────────┴────────┴────────────────────────────────────────────────┘
438
439       Records  of  this  form  replace  the existing labels for a given label
440       type: prior records are not searched for resolving that class of  label
441       in measurements after this timestamp.
442
443       The individual labelset array entries are variable length, depending on
444       the number of labels present within that set.   These  entries  contain
445       the  instance  identifiers  (in  the  case  of  type PM_LABEL_INSTANCES
446       labels), lengths and offsets of each label name and value, and also any
447       flags set for each label.
448
449            ┌───────┬────────┬───────────────────────────────────────────┐
450            │Offset │ Length │                   Name                    │
451            ├───────┼────────┼───────────────────────────────────────────┤
452            │     0 │      4 │ instance identifier (or PM_IN_NULL=-1)    │
453            │     4 │      4 │ length of JSONB label string              │
454            │     8 │      4 │ N: number of labels in this labelset      │
455            │    12 │      2 │ first label name offset                   │
456            │    14 │      1 │ first label name length                   │
457            │    15 │      1 │ first label flags (e.g. optionality)      │
458            │    16 │      2 │ first label value offset                  │
459            │    18 │      2 │ first label value length                  │
460            │    20 │      2 │ second label name offset (if appropriate) │
461            │   ... │    ... │ ...                                       │
462            └───────┴────────┴───────────────────────────────────────────┘
463
464   Help Text
465       This (pmLogText) record stores help text associated with a metric or an
466       instance   domain   -    as    provided    by    pmLookupText(3)    and
467       pmLookupInDomText(3).
468
469       The  metric identifier and instance domain identifier will have already
470       been mentioned in a prior pmDesc record.
471
472
473          ┌───────┬────────┬──────────────────────────────────────────────┐
474          │Offset │ Length │                     Name                     │
475          ├───────┼────────┼──────────────────────────────────────────────┤
476          │     0 │      4 │ tag, TYPE_TEXT=4                             │
477          │     4 │      4 │ text and identifier type (PM_TEXT_* macros.) │
478          │     8 │      4 │ numeric identifier - PMID or instance domain │
479          │    12 │      M │ help text string, arbitrary text             │
480          └───────┴────────┴──────────────────────────────────────────────┘
481

INDEX FILE (.index) RECORDS

483       After the archive label record, the  temporal  index  file  contains  a
484       plainly concatenated, unframed group of tuples, which relate timestamps
485       to the byte offsets in the volume and .meta files.  These  records  are
486       fixed  size,  fixed  format,  and  are  not  enclosed  in  the standard
487       length/payload/length wrapper: they take up the entire remainder of the
488       .index file after the archive label record.
489
490       The temporal index file provides a rapid way of seeking to a particular
491       point of time within an archive for both the performance metric  values
492       and the associated metadata.
493
494       See also libpcp/src/logutil.c.
495
496       The  index  format  differs  between  Version 2 and Version 3, with the
497       latter providing enhanced timestamps (64-bit encoding  of  the  seconds
498       part and nanosecond precision) and 64-bit byte offsets.
499
500
501            ┌────────────────────────────────────────────────────────────┐
502            │                         Version 2                          │
503            ├───────┬────────┬───────────────────────────────────────────┤
504            │Offset │ Length │                   Name                    │
505            ├───────┼────────┼───────────────────────────────────────────┤
506            │     0 │      4 │ timestamp, seconds part (past UNIX epoch) │
507            │     4 │      4 │ timestamp, microseconds part              │
508            │     8 │      4 │ archive volume number (0...N)             │
509            │    12 │      4 │ byte offset in .meta file                 │
510            │    16 │      4 │ byte offset in archive volume file        │
511            └───────┴────────┴───────────────────────────────────────────┘
512
513            ┌────────────────────────────────────────────────────────────┐
514            │                         Version 3                          │
515            ├───────┬────────┬───────────────────────────────────────────┤
516            │Offset │ Length │                   Name                    │
517            ├───────┼────────┼───────────────────────────────────────────┤
518            │     0 │      8 │ timestamp, seconds part (past UNIX epoch) │
519            │     8 │      4 │ timestamp, nanoseconds part               │
520            │    12 │      4 │ archive volume number (0...N)             │
521            │    16 │      8 │ byte offset in .meta file                 │
522            │    24 │      8 │ byte offset in archive volume file        │
523            └───────┴────────┴───────────────────────────────────────────┘
524
525       Since the temporal index is optional, and exists only to speed up time-
526       based random access to metrics and their metadata,  the  index  records
527       are  emitted only intermittently.  An archive reader program should not
528       presume any particular rate of data  flow  into  the  index.   However,
529       common  events  that  may  trigger  a new temporal index record include
530       changes in instance domains, switching over to a  new  archive  volume,
531       and  starting  or  stopping logging.  One reliable invariant however is
532       that, for each index entry, there are to be no meta or  archive  volume
533       records with a timestamp after that in the index, but physically before
534       the associated byte offset in the index.
535
536

FILES

538       Several PCP tools create archives in standard locations:
539
540       $HOME/.pcp/pmlogger
541                 default location for the interactive chart recording mode  in
542                 pmchart(1)
543       $PCP_LOG_DIR/pmlogger
544                 default  location for pmlogger_daily(1) and pmlogger_check(1)
545                 scripts
546

SEE ALSO

548       mkaf(1), PCPIntro(1), pmafm(1), pmchart(1), pmdaproc(1),  pmdumplog(1),
549       pmlogger(1),   pmlogger_check(1),   pmlogger_daily(1),  pmlogreduce(1),
550       pmlogrewrite(1),     pmlogsummary(1),      LOGIMPORT(3),      PMAPI(3),
551       pmLookupDesc(3),         pmLookupInDom(3),        pmLookupInDomText(3),
552       pmLookupLabels(3), pmLookupName(3),  pmLookupText(3),  pcp.conf(5)  and
553       pcp.env(5).
554
555
556
557Performance Co-Pilot                                             LOGARCHIVE(5)
Impressum