1PMREP(1) General Commands Manual PMREP(1)
2
3
4
6 pmrep - performance metrics reporter
7
9 pmrep [-12357CdgGHIjkLnprRuUvVxz?] [-4 action] [-6 sort-metric] [-8|-9
10 limit] [-a archive] [-A align] [--archive-folio folio] [-b|-B space-
11 scale] [-c config] [--container container] [--daemonize] [-e derived]
12 [-E lines] [-f format] [-F outfile] [-h host] [-i instances] [-J rank]
13 [-K spec] [-l delimiter] [-N predicate] [-o output] [-O origin] [-P|-0
14 precision] [-q|-Q count-scale] [-s samples] [-S starttime] [-t inter‐
15 val] [-T endtime] [-w|-W width] [-X label] [-y|-Y time-scale] [-Z time‐
16 zone] metricspec [...]
17
19 pmrep is a customizable performance metrics reporting tool. Any avail‐
20 able performance metric, live or archived, system and/or application,
21 can be selected for reporting using one of the output alternatives
22 listed below together with applicable formatting options.
23
24 pmrep collects the selected metric values through the facilities of the
25 Performance Co-Pilot (PCP), see PCPIntro(1). The metrics to be
26 reported are specified on the command line, in a configuration file, or
27 both. Metrics can be automatically converted and scaled using the PCP
28 facilities, either by default or by per-metric scaling specifications.
29 In addition to the existing metrics, derived metrics can be defined
30 using the arithmetic expressions described in pmRegisterDerived(3).
31
32 Unless directed to another host by the -h option, pmrep will contact
33 the Performance Metrics Collector Daemon (PMCD, see pmcd(1)) on the
34 local host.
35
36 The -a option causes pmrep to use the specified set of archive logs
37 rather than connecting to a PMCD. The -a and -h options are mutually
38 exclusive.
39
40 The -L option causes pmrep to use a local context to collect metrics
41 from DSO PMDAs (Performance Metrics Domain Agents, ``plugins'') on the
42 local host without PMCD. Only some metrics are available in this mode.
43 The -a, -h, and -L options are mutually exclusive.
44
45 The metrics of interest are named in the metricspec argument(s). If a
46 metricspec specifies a non-leaf node in the Performance Metrics Name
47 Space (PMNS), then pmrep will recursively descend the PMNS and report
48 on all leaf nodes (i.e., metrics) for that metricspec. (Use for exam‐
49 ple pminfo(1) to list all the leaf nodes and their descriptions.)
50
51 A metricspec has three different forms. First, on the command line it
52 can start with a colon (``:'') to indicate a metricset to be read from
53 a pmrep configuration file (see pmrep.conf(5)) which can then consist
54 of any number of metricspecs. Second, a metricspec starting with non-
55 colon specifies a PMNS node as described above, optionally followed by
56 metric formatting definitions. This so-called compact form of a met‐
57 ricspec is defined as follows:
58
59 metric[,label[,instances[,unit/scale[,type[,width[,precision[,limit]]]]]]]
60
61 A valid PMNS node (metric) is mandatory. It can be followed by a text
62 label used by supporting output targets (currently: stdout, see below).
63 The optional instances definition restricts csv and stdout reporting to
64 the specified instances (so non-matching instances will be filtered).
65 An optional unit/scale is applicable for dimension-compatible, non-
66 string metrics. (See below for supported unit/scale specifications.)
67 By default, cumulative counter metrics are converted to rates, an
68 optional type can be set to raw to disable this rate conversion. For
69 supporting output targets (currently: stdout) a numeric width can be
70 used to set the width of the output column for this metric. Too-wide
71 numeric values for output will not be printed (apart from trailing dec‐
72 imals, numeric values will never be silently truncated). Too-wide
73 strings will be truncated. Then, a metric-specific precision can be
74 provided for numeric non-integer output values. Lastly, a metric-spe‐
75 cific limit can be set for filtering numeric values per limit.
76
77 As a special case with metrics that are counters with time units
78 (nanoseconds to hours), the unit/scale can be used to change the
79 default reporting (for example, milliseconds / second) to normalize to
80 the range zero to one by setting this to sec (see also -y and -Y).
81
82 The following metricspec requests the metric kernel.all.sysfork to be
83 reported under the text label forks, converting to the default rate
84 count/s in an 8 wide column. Although the definitions in this compact
85 form are optional, they must always be provided in the order specified
86 above.
87
88 kernel.all.sysfork,forks,,,,8
89
90 The third form of a metricspec, verbose form, is described and valid
91 only in pmrep.conf(5).
92
93 Derived metrics are specified like PMNS leaf node metrics.
94
95 Options via environment values (see pmGetOptions(3)) override the cor‐
96 responding built-in default values (if any). Configuration file
97 options override the corresponding environment variables (if any).
98 Command line options override the corresponding configuration file
99 options (if any).
100
102 The available command line options are:
103
104 -0 precision, --precision-force=precision
105 Like -P but this option will override per-metric specifications.
106
107 -1, --dynamic-header
108 Print a new dynamically adjusted header every time changes in
109 availability of metric and instance values occur. By default a
110 static header that never changes is printed once. See also -4,
111 -7, and -E.
112
113 -2, --overall-rank
114 Perform overall ranking of instances in archive. By default rank‐
115 ing (see -J) and reporting happens on each interval. With this
116 option all instances and values are ranked before a summary is
117 reported. See pmlogsummary(1) for further archive summary report‐
118 ing alternatives, including averages and peak times for values.
119
120 -3, --overall-rank-alt
121 Like -2 but print metric instances in pmrep metricspec format, to
122 allow easily selecting the instances for further investigation.
123
124 -4 action, --names-change=action
125 Specify which action to take on receiving a metric names change
126 event during sampling. These events occur when a PMDA discovers
127 new metrics sometime after starting up, and informs running client
128 tools like pmrep. Valid values for action are update (refresh
129 metrics being sampled), ignore (do nothing - the default behav‐
130 iour) and abort (exit the program if such an event happens).
131 update implies --dynamic-header.
132
133 -5, --ignore-unknown
134 Silently ignore any metric name that cannot be resolved. At least
135 one metric must be found for the tool to start.
136
137 -6, --sort-metric=sort-metric
138 Specify a sort reference metric to sort output by values with -X.
139 By default sorting order is descending, prepending the metric name
140 with the minus sign (``-'') will change the order to be ascending.
141 See also -J and -N.
142
143 -7, --fixed-header
144 With -X print a fixed header once (unless using -E) including all
145 metrics being reported. Unlike with the default (static) header,
146 only instances with values available are reported. Unlike with
147 the dynamic header, the header is not updated even if values for
148 some metrics later become (un)available. See also -1 and -E.
149
150 -8 limit, --limit-filter=limit
151 Limit results to instances with values above/below limit. A posi‐
152 tive integer will include instances with values at or above the
153 limit in reporting. A negative integer will include instances
154 with values at or below the limit in reporting. A value of zero
155 performs no limit filtering. This option will not override possi‐
156 ble per-metric specifications. See also -J and -N.
157
158 -9 limit, --limit-filter-force=limit
159 Like -8 but this option will override per-metric specifications.
160
161 -a archive, --archive=archive
162 Performance metric values are retrieved from the set of Perfor‐
163 mance Co-Pilot (PCP) archive log files identified by the argument
164 archive, which is a comma-separated list of names, each of which
165 may be the base name of an archive or the name of a directory con‐
166 taining one or more archives. See also -u.
167
168 -A align, --align=align
169 Force the initial sample to be aligned on the boundary of a natu‐
170 ral time unit align. Refer to PCPIntro(1) for a complete descrip‐
171 tion of the syntax for align.
172
173 --archive-folio=folio
174 Read metric source archives from the PCP archive folio created by
175 tools like pmchart(1) or, less often, manually with mkaf(1).
176
177 -b scale, --space-scale=scale
178 Unit/scale for space (byte) metrics, possible values include
179 bytes, Kbytes, KB, Mbytes, MB, and so forth. This option will not
180 override possible per-metric specifications. See also pmParseU‐
181 nitsStr(3).
182
183 -B scale, --space-scale-force=scale
184 Like -b but this option will override per-metric specifications.
185
186 -c config, --config=config
187 Specify the config file to use. The default is the first found
188 of: ./pmrep.conf, $HOME/.pmrep.conf, $HOME/pcp/pmrep.conf, and
189 $PCP_SYSCONF_DIR/pmrep/pmrep.conf. See pmrep.conf(5).
190
191 --container=container
192 Fetch performance metrics from the specified container, either
193 local or remote (see -h).
194
195 -C, --check
196 Exit before reporting any values, but after parsing the configura‐
197 tion and metrics and printing possible headers.
198
199 -d, --delay
200 When replaying from an archive, this option requests that the pre‐
201 vailing real-time delay be applied between samples (see -t) to
202 effect a pause, rather than the default behaviour of replaying at
203 full speed.
204
205 --daemonize
206 Daemonize on startup.
207
208 -e derived, --derived=derived
209 Specify derived performance metrics. If derived starts with a
210 slash (``/'') or with a dot (``.'') it will be interpreted as a
211 derived metrics configuration file, otherwise it will be inter‐
212 preted as comma- or semicolon-separated derived metric expres‐
213 sions. For details see pmLoadDerivedConfig(3) and pmRegister‐
214 Derived(3).
215
216 -E lines, --repeat-header=lines
217 Repeat the header every lines of output. See also -1 and -7.
218
219 -f format, --timestamp-format=format
220 Use the format string for formatting the timestamp. The format
221 will be used with Python's datetime.strftime method which is
222 mostly the same as that described in strftime(3). An empty format
223 string (i.e., "") will remove the timestamps from the output.
224 Defaults to %H:%M:%S when using the stdout output target.
225 Defaults to %Y-%m-%d %H:%M:%S when using the csv output target.
226
227 -F outfile, --output-file=outfile
228 Specify the output file outfile. See -o.
229
230 -g, --separate-header
231 Output the column number and complete metric information, one-per-
232 line, before printing the metric values.
233
234 -G, --no-globals
235 Do not include global metrics in reporting (see pmrep.conf(5)).
236
237 -h host, --host=host
238 Fetch performance metrics from pmcd(1) on host, rather than from
239 the default localhost.
240
241 -H, --no-header
242 Do not print any headers.
243
244 -i instances, --instances=instances
245 Report only the listed instances from current instances (if
246 present, see also -j). By default all current instances are
247 reported, except when writing an archive (see -o) when all
248 instances, present and future, are reported. This is a global
249 option that is used for all metrics unless a metric-specific
250 instance definition is provided as part of a metricspec. By
251 default single-valued ``flat'' metrics without multiple instances
252 are still reported as usual, use -v to change this.
253
254 The list may consist of one or more comma-separated instances.
255 The instance name may be quoted with single (') or double (")
256 quotes for those cases where the instance name contains commas or
257 whitespace. Note that on the command line when specifying more
258 than one instance, all the names must be quoted.
259
260 Multiple -i options are allowed as an alternative way of specify‐
261 ing more than one instance of interest. Regular expressions can
262 also be used.
263
264 As an example, the following would report the same instances:
265
266 $ pmrep -i "'1 minute','5 minute'" kernel.all.load
267 $ pmrep -i '"1 minute","5 minute"' kernel.all.load
268 $ pmrep -i "'1 minute'" -i "'5 minute'" kernel.all.load
269 $ pmrep kernel.all.load,,"'1 minute','5 minute'"
270 $ pmrep kernel.all.load,,'"1 minute","5 minute"'
271
272
273 However, this would report only the 1-minute instance:
274
275 $ pmrep -i '"1 minute","5 minute"' kernel.all.load,,"1 minute"
276
277
278 But this would report all instances (due to per-metric override):
279
280 $ pmrep -i '"1 minute","5 minute"' 'kernel.all.load,,.*'
281
282
283 -I, --ignore-incompat
284 Ignore incompatible metrics. By default incompatible metrics
285 (that is, their type is unsupported or they cannot be scaled as
286 requested) will cause pmrep to terminate with an error message.
287 With this option all incompatible metrics are silently omitted
288 from reporting. This may be especially useful when requesting
289 non-leaf nodes of the PMNS tree for reporting.
290
291 -j, --live-filter
292 Perform instance live filtering. This allows capturing all fil‐
293 tered instances even if processes are restarted at some point
294 (unlike without live filtering). Performing live filtering over a
295 huge amount of instances will add some internal overhead so a bit
296 of user caution is advised. See also -1 and -n.
297
298 -J rank, --rank=rank
299 Limit results to highest/lowest rank instances of set-valued met‐
300 rics. A positive integer will include highest valued instances in
301 reporting. A negative integer will include lowest valued
302 instances in reporting. A value of zero performs no ranking. See
303 also -2, -6 and -8.
304
305 -k, --extended-csv
306 Write extended CSV output, similar to sadf(1).
307
308 -K spec, --spec-local=spec
309 When fetching metrics from a local context (see -L), the -K option
310 may be used to control the DSO PMDAs that should be made accessi‐
311 ble. The spec argument conforms to the syntax described in
312 pmSpecLocalPMDA(3). More than one -K option may be used.
313
314 -l delimiter, --delimiter=delimiter
315 Specify the delimiter that separates each column of csv or stdout
316 output. The default for stdout is two spaces (`` '') and comma
317 (``,'') for csv. In case of CSV output or stdout output with non-
318 whitespace delimiter, any instances of the delimiter in string
319 values will be replaced by the underscore (``_'') character.
320
321 -L, --local-PMDA
322 Use a local context to collect metrics from DSO PMDAs on the local
323 host without PMCD. See also -K.
324
325 -n, --invert-filter
326 Perform ranking before live filtering. By default instance live
327 filtering (when requested, see -j) happens before instance ranking
328 (when requested, see -J). With this option the logic is inverted
329 and ranking happens before live filtering.
330
331 -N predicate, --predicate=predicate
332 Specify a comma-separated list of predicate filter reference met‐
333 rics. By default ranking (see -J) happens for each metric indi‐
334 vidually. With predicates, ranking is done only for the specified
335 predicate metrics. When reporting, rest of the metrics sharing
336 the same instance domain (see PCPIntro(1)) as the predicate will
337 include only the highest/lowest ranking instances of the corre‐
338 sponding predicate.
339
340 So for example, using proc.memory.rss (resident memory size of
341 process) as the predicate metric together with proc.io.total_bytes
342 and mem.util.used as metrics to be reported, only the processes
343 using most/least (as per -J) memory will be included when report‐
344 ing total bytes written by processes. Since mem.util.used is a
345 single-valued metric (thus not sharing the same instance domain as
346 the process-related metrics), it will be reported as usual.
347
348 -o output, --output=output
349 Use output target for reporting. The default target is stdout.
350 The available target alternatives are:
351
352 archive
353 Record metrics into a PCP archive which can later be replayed
354 with PCP tools, including pmrep itself. See LOGARCHIVE(5) and
355 PCPIntro(1) for details about PCP archive files. Requires -F.
356
357 csv
358 Print metrics in CSV format (subject to formatting options).
359
360 stdout
361 Print metrics to stdout (format subject to formatting options).
362
363 -O origin, --origin=origin
364 When reporting archived metrics, start reporting at origin within
365 the time window (see -S and -T). Refer to PCPIntro(1) for a com‐
366 plete description of the syntax for origin.
367
368 -p, --timestamps
369 Print timestamps. By default no timestamps are printed.
370
371 -P precision, --precision=precision
372 Use precision for numeric non-integer output values. If the value
373 is too wide for its column width, precision is reduced one by one
374 until the value fits, or not printed at all if it does not. The
375 default is to use 3 decimal places (when applicable). This option
376 will not override possible per-metric specifications.
377
378 -q scale, --count-scale=scale
379 Unit/scale for count metrics, possible values include count x
380 10^-1, count, count x 10, count x 10^2, and so forth from 10^-8 to
381 10^7. (These values are currently space-sensitive.) This option
382 will not override possible per-metric specifications. See also
383 pmParseUnitsStr(3).
384
385 -Q scale, --count-scale-force=scale
386 Like -q but this option will override per-metric specifications.
387
388 -r, --raw
389 Output raw metric values, do not convert cumulative counters to
390 rates. When writing archives, raw values are always used. This
391 option will override possible per-metric specifications.
392
393 -R, --raw-prefer
394 Like -r but this option will not override per-metric specifica‐
395 tions.
396
397 -s samples, --samples=samples
398 The argument samples defines the number of samples to be retrieved
399 and reported. If samples is 0 or -s is not specified, pmrep will
400 sample and report continuously (in real time mode) or until the
401 end of the set of PCP archives (in archive mode). See also -T.
402
403 -S starttime, --start=starttime
404 When reporting archived metrics, the report will be restricted to
405 those records logged at or after starttime. Refer to PCPIntro(1)
406 for a complete description of the syntax for starttime.
407
408 -t interval, --interval=interval
409 The default update interval may be set to something other than the
410 default 1 second. The interval argument follows the syntax
411 described in PCPIntro(1), and in the simplest form may be an
412 unsigned integer (the implied units in this case are seconds).
413 See also the -T and -u options.
414
415 -T endtime, --finish=endtime
416 When reporting archived metrics, the report will be restricted to
417 those records logged before or at endtime. Refer to PCPIntro(1)
418 for a complete description of the syntax for endtime.
419
420 When used to define the runtime before pmrep will exit, if no sam‐
421 ples is given (see -s) then the number of reported samples depends
422 on interval (see -t). If samples is given then interval will be
423 adjusted to allow reporting of samples during runtime. In case
424 all of -T, -s, and -t are given, endtime determines the actual
425 time pmrep will run.
426
427 -u, --no-interpol
428 When reporting archived metrics, by default values are reported
429 according to the selected sample interval (-t option), not accord‐
430 ing to the actual record interval in an archive. To this effect
431 PCP interpolates the values to be reported based on the records in
432 the archive. With the -u option uninterpolated reporting is
433 enabled, every recorded value for the selected metrics is reported
434 and the requested sample interval (-t) is ignored.
435
436 So for example, if a PCP archive contains recorded values for
437 every 10 seconds and the requested sample interval is 1 hour, by
438 default pmrep will use an interpolation scheme to compute the val‐
439 ues of the requested metrics from the values recorded in the prox‐
440 imity of these requested metrics and values for every 1 hour are
441 reported. With -u every record every 10 seconds are reported as
442 such (the reported values are still subject to rate conversion,
443 use -r or -R to disable).
444
445 -U, --no-unit-info
446 Omit unit information from headers.
447
448 -v, --omit-flat
449 Omit single-valued ``flat'' metrics from reporting, only consider
450 set-valued metrics (i.e., metrics with multiple values) for
451 reporting. See -i and -I.
452
453 -V, --version
454 Display version number and exit.
455
456 -w width, --width=width
457 Set the stdout output column width. Strings will be truncated to
458 this width. The default width is the shortest that can fit the
459 metric text label, the forced minimum is 3. This option will not
460 override possible per-metric specifications.
461
462 -W width, --width-force=width
463 Like -w but this option will override per-metric specifications.
464
465 -x, --extended-header
466 Print extended header.
467
468 -X label, --colxrow=label
469 Swap columns and rows in stdout output, reporting one instance per
470 line, using label as the text label for instance column (set to an
471 empty string "" to enable swapping without a specific text label).
472 This is convenient to allow easily using grep(1) to filter results
473 or to more closely mimic other utilities. See also -i and -6.
474
475 -y scale, --time-scale=scale
476 Unit/scale for time metrics, possible values include nanosec, ns,
477 microsec, us, millisec, ms, and so forth up to hour, hr. This
478 option will not override possible per-metric specifications. See
479 also pmParseUnitsStr(3).
480
481 -Y scale, --time-scale-force=scale
482 Like -y but this option will override per-metric specifications.
483
484 -z, --hostzone
485 Use the local timezone of the host that is the source of the per‐
486 formance metrics, as identified by either the -h or the -a
487 options. The default is to use the timezone of the local host.
488
489 -Z timezone, --timezone=timezone
490 Use timezone for the date and time. Timezone is in the format of
491 the environment variable TZ as described in environ(7). Note that
492 when including a timezone string in output, ISO 8601 -style UTC
493 offsets are used (so something like -Z EST+5 will become UTC-5).
494
495 -?, --help
496 Display usage message and exit.
497
499 The following examples use the standard PCP facilities for collecting
500 the metric values, no external utilities are needed. The referenced
501 colon-starting metricsets are part of the system pmrep.conf file.
502
503 Display network interface metrics on the local host:
504 $ pmrep network.interface.total.bytes
505
506 Display all outgoing network metrics for the wlan0 interface:
507 $ pmrep -i wlan0 -v network.interface.out
508
509 Display timestamped vmstat(8) like information using megabytes instead
510 of kilobytes and also include the number of inodes used (tab completes
511 available metrics and after a colon metricsets with bash and zsh):
512 $ pmrep -p -B MB :vmstat vfs.inodes.count
513
514 Display per-device disk reads and writes from the host server1 using
515 two seconds interval and sadf(1) like CSV output format:
516 $ pmrep -h server1 -t 2s -o csv -k disk.dev.read disk.dev.write
517
518 Display processes using at least 100MB of memory using dynamic headers:
519 $ pmrep -b MB --limit-filter 100 --dynamic-header proc.memory.rss
520
521 Display the predefined set of metrics from the default pmrep.conf(5)
522 containing information about I/O issued by current firefox process(es):
523 $ pmrep -i '.*firefox.*' :proc-io
524
525 Display the three most CPU-using processes:
526 $ pmrep -1gUJ 3 proc.hog.cpu
527
528 Display sar -w and sar -W like information at the same time from the
529 PCP archive ./20150921.09.13 showing values recorded between 3 - 5 PM:
530 $ pmrep -a ./20150921.09.13 -S @15:00 -T @17:00 :sar-w :sar-W
531
532 Record most relevant CPU, memory, and I/O related information about
533 every Java process on the system, present and future, to an archive ./a
534 on one minute interval at every full minute in a background process:
535 $ pmrep --daemonize -A 1m -t 1m -i '.*java.*' -j -o archive -F ./a \
536 :proc-info :proc-cpu :proc-mem :proc-io
537
538 Record all 389 Directory Server, XFS file system, and CPU/memory/disk
539 metrics every five seconds for five minutes to a PCP archive ./a:
540 $ pmrep -t 5s -T 5m -o archive -F ./a ds389 xfs kernel.all.cpu mem disk
541
542 Record process memory and I/O information for those processes which are
543 the three most memory-consuming processes:
544 $ pmrep -o archive -F ./a -J 3 -N proc.memory.rss proc.memory proc.io
545
547 pmrep.conf
548 pmrep configuration file (see -c)
549
550 $PCP_SYSCONF_DIR/pmrep/pmrep.conf
551 system provided pmrep configuration file
552
554 Environment variables with the prefix PCP_ are used to parameterize the
555 file and directory names used by PCP. On each installation, the file
556 /etc/pcp.conf contains the local values for these variables. The
557 $PCP_CONF variable may be used to specify an alternative configuration
558 file, as described in pcp.conf(5).
559
560 For environment variables affecting PCP tools, see pmGetOptions(3).
561
563 mkaf(1), PCPIntro(1), pcp(1), pcp-atop(1), pcp2elasticsearch(1),
564 pcp2graphite(1), pcp2influxdb(1), pcp2json(1), pcp2spark(1),
565 pcp2xlsx(1), pcp2xml(1), pcp2zabbix(1), pmcd(1), pmchart(1), pmcol‐
566 lectl(1), pmdiff(1), pmdumplog(1), pmdumptext(1), pminfo(1), pmio‐
567 stat(1), pmlogextract(1), pmlogsummary(1), pmprobe(1), pmstat(1),
568 pmval(1), sadf(1), sar(1), pmGetOptions(3), pmSpecLocalPMDA(3), pmLoad‐
569 DerivedConfig(3), pmParseUnitsStr(3), pmRegisterDerived(3), strf‐
570 time(3), LOGARCHIVE(5), pcp.conf(5), pmns(5), pmrep.conf(5), environ(7)
571 and vmstat(8).
572
573
574
575Performance Co-Pilot PCP PMREP(1)