1PMSERIES(1)                 General Commands Manual                PMSERIES(1)
2
3
4

NAME

6       pmseries - display information about performance metric timeseries
7

SYNOPSIS

9       pmseries [-adFiIlLmMnqsSV] [-c config] [-g pattern] [-h host] [-p port]
10       [query | series ... | source ... ]
11

DESCRIPTION

13       pmseries displays various types of information about  performance  met‐
14       rics  available  through the scalable timeseries facilities of the Per‐
15       formance Co-Pilot (PCP) and the Redis distributed data store.
16
17       By default pmseries communicates with a local redis-server(1),  however
18       the -h/--host and -p/--port options can be used to specify an alternate
19       Redis instance.  If this instance is a node of  a  Redis  cluster,  all
20       other  instances  in  the cluster will be discovered and used automati‐
21       cally.
22
23       pmseries runs in several different modes - either  querying  timeseries
24       identifiers,  metadata or values (already stored in Redis), or manually
25       loading timeseries into Redis.  The latter mode is  seldom  used,  how‐
26       ever, since pmproxy(1) will automatically perform this function when it
27       is started with the -t/--timeseries option.  In time, this option  will
28       become enabled by default.
29
30       Without  command line options specifying otherwise, pmseries will issue
31       a timeseries query to find matching timeseries and values.   All  time‐
32       series  are  identified  using a unique SHA-1 hash which is always dis‐
33       played in a 40-hexdigit human readable form.  These hashes  are  formed
34       using the metadata associated with every metric.
35
36       Importantly, this includes all metric metadata (labels, names, descrip‐
37       tors).  Metric labels in particular are (as far as possible) unique for
38       every  machine  - on Linux for example the labels associated with every
39       metric include the unique /etc/machine-id,  the  hostname,  domainname,
40       and other automatically generated machine labels, as well as any admin‐
41       istrator-defined labels from  /etc/pcp/labels.   These  labels  can  be
42       reported with pminfo(1) and the pmcd.labels metric.
43
44       See    pmLookupLabels(3),    pmLookupInDom(3),    pmLookupName(3)   and
45       pmLookupDesc(3) for detailed information about metric labels and  other
46       metric metadata used in each timeseries identifier hash calculation.
47
48       The timeseries identifiers provide a higher level (and machine indepen‐
49       dent) identifier than the traditional PCP  performance  metric  identi‐
50       fiers  (pmID),  instance domain identifiers (pmInDom) and metric names.
51       See PCPIntro(1) for more details about these  traditional  identifiers.
52       However, pmseries uses timeseries identifiers in much the same way that
53       pminfo(1) uses the lower level indom,  metric  identifiers  and  metric
54       names.
55
56       The  default  mode  of  pmseries  operation  (i.e. with no command line
57       options) depends on the arguments it is presented.  If  all  non-option
58       arguments  appear  to  be timeseries identifiers (in 40 hex digit form)
59       pmseries will report metadata for  these  timeseries  -  refer  to  the
60       -a/--all option for details.  Otherwise, the parameters will be treated
61       as a timeseries query.
62

TIMESERIES QUERIES

64       Query  expressions  are  formed  using  the  pmseries  query   language
65       described below, but can be as simple as a metric name.
66
67       The  following is an example of querying timeseries from all hosts that
68       match a metric name pattern (globbed):
69
70         $ pmseries kernel.all.cpu*
71         1d7b0bb3f6aec0f49c54f5210885464a53629b60
72         379db729afd63fb9eff436625bd6c55a7adc5cfd
73         3dd3b45bb05f96636043e5d58b52b441ce542285
74         [...]
75         ed2bf325ff6dc7589ec966698e5404b67252306a
76         dcb2a032a308b5717bf605ba8f8737e9c6e1ed19
77
78       To identify timeseries, the query language uses the general syntax:
79
80         [metric.name] '{metadata qualifiers}' '[time specification]'
81
82       The metric.name component restricts the timeseries query to any  match‐
83       ing PCP metric name (the list of metric names for a PCP archive or live
84       host is reported by pminfo(1) with no arguments beyond --host or  --ar‐
85       chive).   The  pmseries syntax extends on that of pminfo and allows for
86       glob(7) based pattern matching within the metric name.
87

METADATA QUALIFIERS AND OPERATORS

89       Metadata qualifiers are enclosed by ``curly'' braces ({}), and  further
90       restrict  the query results to timeseries with various metadata proper‐
91       ties.  These qualifiers are based on metric or instance names, and met‐
92       ric label values, and take the general form metadata.name OPERATOR val‐
93       ue, such as:
94
95         instance.name == "cpu0"
96         metric.name != "kernel.all.pswitch"
97
98       When using label names, the metadata qualifier is optional and  can  be
99       dropped, such as:
100
101         label.hostname == "www.acme.com"
102         hostname == "www.acme.com"
103
104       For  metric and instance names only the string operators apply, but for
105       metric label values all operators are available.  The set of  available
106       operators is:
107
108   Boolean operators
109       All  string  (label,  metrics and instances) and numeric (label) values
110       can be tested for equality ("==") or inequality ("!=").
111
112   String operators
113       Strings can be subject to pattern matching in the form of glob matching
114       ("~~"), regular expression matching ("=~"), and regular expression non-
115       matching ("!~").  The ":" operator is equivalent to "~~" - i.e.,  regu‐
116       lar expression matching.
117
118   Relational operators (numeric label values only)
119       Numeric  label  values  can  be subject to the less than ("<"), greater
120       than (">"), less than or equal ("<="), greater than  or  equal  (">="),
121       equal ("==") and not equal ("!=") operators.
122
123   Logical operators
124       Multiple metadata qualifiers can be combined with the logical operators
125       for AND ("&&") and OR ("||") as in  many  programming  languages.   The
126       comma (",") character is equivalent to logical AND ("&&").
127

TIME SPECIFICATION

129       The  final (optional) component of a query allows the user to specify a
130       specific time window of interest.  Any time specification  will  result
131       in  values being returned for all matching timeseries only for the time
132       window specified.
133
134       The specification is ``square'' bracket ([]) enclosed, and consists  of
135       one  or more comma-separated components.  Each component specifies some
136       aspect related to time, taking the general form: keyword:  value,  such
137       as:
138
139         samples: 10
140
141   Sample count
142       The  number  of  samples to return, specified via either the samples or
143       (equivalent) count keyword.  The value provided must be a positive  in‐
144       teger.   If  no  end time is explicitly set (see ``Time window'' later)
145       then the most recent samples will be returned.
146
147   Sample interval
148       An interval between successive samples can be requested using  the  in‐
149       terval or (equivalent) delta keyword.  The value provided should be ei‐
150       ther a numeric or string value that will be parsed by pmParseTimeInter‐
151       val(3), such as 5 (seconds) or 2min (minutes).
152
153   Time window
154       Start  and  end  times,  and alignments, affecting the returned values.
155       The keywords match the parameters to the pmParseTimeWindow(3)  function
156       which will be used to parse them, and are: start or (equivalent) begin,
157       finish or (equivalent) end, align and offset.
158
159   Time zones
160       The resulting timestamps can be returned having been  evaluated  for  a
161       specific  timezone, using the timezone or hostzone keywords.  The value
162       associated with timezone will be interpreted by pmNewZone(3).   A  true
163       or false value should be associated with hostzone, and when set to true
164       this has the same effect as described by pmNewContextZone(3).
165

TIMESERIES METADATA

167       Using command line options, pmseries can be requested to provide  meta‐
168       data  (metric  names,  instance  names, labels, descriptors) associated
169       with either individual timeseries or a group of timeseries,  for  exam‐
170       ple:
171
172         $ pmseries -a dcb2a032a308b5717bf605ba8f8737e9c6e1ed19
173
174         dcb2a032a308b5717bf605ba8f8737e9c6e1ed19
175             PMID: 60.0.21
176             Data Type: 64-bit unsigned int  InDom: PM_INDOM_NULL 0xffffffff
177             Semantics: counter  Units: millisec
178             Source: f5ca7481da8c038325d15612bb1c6473ce1ef16f
179             Metric: kernel.all.cpu.nice
180             labels {"agent":"linux","domainname":"localdomain",\
181                     "groupid":1000,"hostname":"shard",\
182                     "latitude":-25.28496,"longitude":152.87886,\
183                     "machineid":"295b16e3b6074cc8bdbda8bf96f6930a",\
184                     "userid":1000}
185
186       The complete set of pmseries metadata reporting options are:
187
188       -a, --all
189            Convenience  option  to  report  all  metadata for the given time‐
190            series, equivalent to -dilms.
191
192       -d, --desc
193            Metric descriptions detailing the PMID, data type, data semantics,
194            units,  scale  and  associated instance domain.  This option has a
195            direct pminfo(1) equivalent.
196
197       -g pattern, --glob=pattern
198            Provide a glob(7) pattern to restrict the report provided  by  the
199            -i, -l, -m, and -S.
200
201       -i, --instances
202            Metric descriptions detailing the PMID, data type, data semantics,
203            units, scale and associated instance domain.
204
205       -I, --fullindom
206            Print the InDom in verbose mode.  This option has a  direct  pmin‐
207            fo(1) equivalent.
208
209       -l, --labels
210            Print  label  sets  associated with metrics and instances.  Labels
211            are optional metric metadata described in  detail  in  pmLookupLa‐
212            bels(3).  This option has a direct pminfo(1) equivalent.
213
214       -m, --metrics
215            Print metric names.
216
217       -M, --fullpmid
218            Print  the  PMID  in verbose mode.  This option has a direct pmin‐
219            fo(1) equivalent.
220
221       -n, --names
222            Print comma-separated label names only (not values) for the labels
223            associated with metrics and instances.
224
225       -s, --series
226            Print  timeseries  identifiers  associated with metrics, instances
227            and sources.  These unique identifiers are calculated from intrin‐
228            sic  (non-optional)  labels  and  other metric metadata associated
229            with each PMAPI context (sources),  metrics  and  instances.   Ar‐
230            chive,  local context or pmcd(1) connections for the same host all
231            produce the same source identifier.   This  option  has  a  direct
232            pminfo(1) equivalent.  See also pmLookupLabels(3) and the -l/--la‐
233            bels option.
234

TIMESERIES SOURCES

236       A source is a unique identifier (represented externally  as  a  40-byte
237       hexadecimal  SHA-1  hash) that represents both the live host and/or ar‐
238       chives from which each timeseries originated.  The context for a source
239       identifier (obtained with -s) can be reported with:
240
241       -S, --sources
242            Print  names for timeseries sources.  These names are either host‐
243            names or fully qualified archive paths.
244
245       It is important to note that live and archived  sources  can  and  will
246       generate  the same SHA-1 source identifier hash, provided that the con‐
247       text labels remain the same for that host (labels are stored in PCP ar‐
248       chives and can also be fetched live from pmcd(1)).
249

TIMESERIES LOADING

251       Timeseries metadata and data are loaded either automatically by a local
252       pmproxy(1), or manually using a specially crafted  pmseries  query  and
253       the -L/--load option:
254
255         $ pmseries --load "{source.path: \"$PCP_LOG_DIR/pmlogger/acme\"}"
256         pmseries: [Info] processed 2275 archive records from [...]
257
258       This  query  must  specify a source archive path, but can also restrict
259       the import to specific timeseries (using metric names, labels, etc) and
260       to a specific time window using the time specification component of the
261       query language.
262

OPTIONS

264       The available command line options, in addition to timeseries  metadata
265       and sources options described above, are:
266
267       -c config, --config=config
268            Specify the config file to use.
269
270       -h host, --host=host
271            Connect Redis server at host, rather than the one the localhost.
272
273       -L, --load
274            Load timeseries metadata and data into the Redis cluster.
275
276       -p port, --port=port
277            Connect Redis server at port, rather than the default 6379.
278
279       -q, --query
280            Perform a timeseries query.  This is the default action.
281
282       -V, --version
283            Display version number and exit.
284
285       -?, --help
286            Display usage message and exit.
287

EXAMPLES

289       The following sample query shows several fundamental aspects of the pm‐
290       series query language:
291
292         $ pmseries 'kernel.all.load{hostname:toium}[count:2]'
293
294         eb713a9cf472f775aa59ae90c43cd7f960f7870f
295             [1545346764128.128] 1.0e-01 b84040ffccd54f839b65140cf139bab51cbbcf62
296             [1545346764128.128] 6.8e-01 a60b5b3bf25e71071c41934fa4d7d251f765f30c
297             [1545346764128.128] 6.4e-01 e1974a062375e6e62370ffadf5b0650dad739480
298             [1545346774112.112] 1.6e-01 b84040ffccd54f839b65140cf139bab51cbbcf62
299             [1545346774112.112] 6.7e-01 a60b5b3bf25e71071c41934fa4d7d251f765f30c
300             [1545346774112.112] 6.4e-01 e1974a062375e6e62370ffadf5b0650dad739480
301
302       This query returns the two most recent values for all instances of  the
303       kernel.all.load  metric  with a label.hostname matching the regular ex‐
304       pression "toium".  This is a set-valued metric (i.e., a metric with  an
305       ``instance  domain'' which in this case consists of three instances: 1,
306       5 and 15 minute averages).  The first column returned is  a  timestamp,
307       then  a  floating point value, and finally an instance identifier time‐
308       series hash (two values returned for three instances, so six  rows  are
309       returned).  The metadata for these timeseries can then be further exam‐
310       ined:
311
312         $ pmseries -a eb713a9cf472f775aa59ae90c43cd7f960f7870f
313
314         eb713a9cf472f775aa59ae90c43cd7f960f7870f
315             PMID: 60.2.0
316             Data Type: float  InDom: 60.2 0xf000002
317             Semantics: instant  Units: none
318             Source: 0e89c1192db79326900d82131c31399524f0b3ee
319             Metric: kernel.all.load
320             inst [1 or "1 minute"] series b84040ffccd54f839b65140cf139bab51cbbcf62
321             inst [5 or "5 minute"] series a60b5b3bf25e71071c41934fa4d7d251f765f30c
322             inst [15 or "15 minute"] series e1974a062375e6e62370ffadf5b0650dad739480
323             inst [1 or "1 minute"] labels {"agent":"linux","hostname":"toium"}
324             inst [5 or "5 minute"] labels {"agent":"linux","hostname":"toium"}
325             inst [15 or "15 minute"] labels {"agent":"linux","hostname":"toium"}
326

PCP ENVIRONMENT

328       Environment variables with the prefix PCP_ are used to parameterize the
329       file  and  directory names used by PCP.  On each installation, the file
330       /etc/pcp.conf contains the  local  values  for  these  variables.   The
331       $PCP_CONF  variable may be used to specify an alternative configuration
332       file, as described in pcp.conf(5).
333

SEE ALSO

335       PCPIntro(1), pmcd(1), pminfo(1), pmproxy(1), redis-server(1), PMAPI(3),
336       PMWEBAPI(3),  pmLookupDesc(3), pmLookupInDom(3), pmLookupLabels(3), pm‐
337       LookupName(3),  pmNewContextZone(3),  pmNewZone(3),   pmParseTimeInter‐
338       val(3), pmParseTimeWindow(3), pcp.conf(5), glob(7) and regex(7).
339
340
341
342Performance Co-Pilot                  PCP                          PMSERIES(1)
Impressum