1PMREP(1) General Commands Manual PMREP(1)
2
3
4
6 pmrep - performance metrics reporter
7
9 pmrep [-12357CdgGHIjkLmnprRuUvVxz?] [-4 action] [-6 sort-metric]
10 [-8|-9 limit] [-a archive] [-A align] [--archive-folio folio] [-b|-B
11 space-scale] [-c config] [--container container] [--daemonize] [-e
12 derived] [-E lines] [-f format] [-F outfile] [-h host] [-i instances]
13 [--include-texts] [-J rank] [-K spec] [-l delimiter] [-N predicate] [-o
14 output] [-O origin] [-P|-0 precision] [-q|-Q count-scale] [-s samples]
15 [-S starttime] [-t interval] [-T endtime] [-w|-W width] [-X label]
16 [-y|-Y time-scale] [-Z timezone] 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 archive
164 argument, 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 --include-texts
292 When writing a PCP archive, include PCP metric help texts in the
293 created archive.
294
295 -j, --live-filter
296 Perform instance live filtering. This allows capturing all fil‐
297 tered instances even if processes are restarted at some point
298 (unlike without live filtering). Performing live filtering over a
299 huge amount of instances will add some internal overhead so a bit
300 of user caution is advised. See also -1 and -n.
301
302 -J rank, --rank=rank
303 Limit results to highest/lowest ranked instances of set-valued
304 metrics. A positive integer will include highest valued instances
305 in reporting. A negative integer will include lowest valued
306 instances in reporting. A value of zero performs no ranking.
307 Ranking does not imply sorting, see -6. See also -2 and -8.
308
309 -k, --extended-csv
310 Write extended CSV output, similar to sadf(1).
311
312 -K spec, --spec-local=spec
313 When fetching metrics from a local context (see -L), the -K option
314 may be used to control the DSO PMDAs that should be made accessi‐
315 ble. The spec argument conforms to the syntax described in
316 pmSpecLocalPMDA(3). More than one -K option may be used.
317
318 -l delimiter, --delimiter=delimiter
319 Specify the delimiter that separates each column of csv or stdout
320 output. The default for stdout is two spaces (`` '') and comma
321 (``,'') for csv. In case of CSV output or stdout output with non-
322 whitespace delimiter, any instances of the delimiter in string
323 values will be replaced by the underscore (``_'') character.
324
325 -L, --local-PMDA
326 Use a local context to collect metrics from DSO PMDAs on the local
327 host without PMCD. See also -K.
328
329 -m, --include-labels
330 Include metric labels in the output.
331
332 -n, --invert-filter
333 Perform ranking before live filtering. By default instance live
334 filtering (when requested, see -j) happens before instance ranking
335 (when requested, see -J). With this option the logic is inverted
336 and ranking happens before live filtering.
337
338 -N predicate, --predicate=predicate
339 Specify a comma-separated list of predicate filter reference met‐
340 rics. By default ranking (see -J) happens for each metric indi‐
341 vidually. With predicates, ranking is done only for the specified
342 predicate metrics. When reporting, rest of the metrics sharing
343 the same instance domain (see PCPIntro(1)) as the predicate will
344 include only the highest/lowest ranking instances of the corre‐
345 sponding predicate. Ranking does not imply sorting, see -6.
346
347 So for example, using proc.memory.rss (resident memory size of
348 process) as the predicate metric together with proc.io.total_bytes
349 and mem.util.used as metrics to be reported, only the processes
350 using most/least (as per -J) memory will be included when report‐
351 ing total bytes written by processes. Since mem.util.used is a
352 single-valued metric (thus not sharing the same instance domain as
353 the process-related metrics), it will be reported as usual.
354
355 -o output, --output=output
356 Use output target for reporting. The default target is stdout.
357 The available target alternatives are:
358
359 archive
360 Record metrics into a PCP archive which can later be replayed
361 with PCP tools, including pmrep itself. See LOGARCHIVE(5) and
362 PCPIntro(1) for details about PCP archive files. Requires -F.
363
364 csv
365 Print metrics in CSV format (subject to formatting options).
366
367 stdout
368 Print metrics to stdout (format subject to formatting options).
369
370 -O origin, --origin=origin
371 When reporting archived metrics, start reporting at origin within
372 the time window (see -S and -T). Refer to PCPIntro(1) for a com‐
373 plete description of the syntax for origin.
374
375 -p, --timestamps
376 Print timestamps. By default no timestamps are printed.
377
378 -P precision, --precision=precision
379 Use precision for numeric non-integer output values. If the value
380 is too wide for its column width, precision is reduced one by one
381 until the value fits, or not printed at all if it does not. The
382 default is to use 3 decimal places (when applicable). This option
383 will not override possible per-metric specifications.
384
385 -q scale, --count-scale=scale
386 Unit/scale for count metrics, possible values include count x
387 10^-1, count, count x 10, count x 10^2, and so forth from 10^-8 to
388 10^7. (These values are currently space-sensitive.) This option
389 will not override possible per-metric specifications. See also
390 pmParseUnitsStr(3).
391
392 -Q scale, --count-scale-force=scale
393 Like -q but this option will override per-metric specifications.
394
395 -r, --raw
396 Output raw metric values, do not convert cumulative counters to
397 rates. When writing archives, raw values are always used. This
398 option will override possible per-metric specifications.
399
400 -R, --raw-prefer
401 Like -r but this option will not override per-metric specifica‐
402 tions.
403
404 -s samples, --samples=samples
405 The samples argument defines the number of samples to be retrieved
406 and reported. If samples is 0 or -s is not specified, pmrep will
407 sample and report continuously (in real time mode) or until the
408 end of the set of PCP archives (in archive mode). See also -T.
409
410 -S starttime, --start=starttime
411 When reporting archived metrics, the report will be restricted to
412 those records logged at or after starttime. Refer to PCPIntro(1)
413 for a complete description of the syntax for starttime.
414
415 -t interval, --interval=interval
416 Set the reporting interval to something other than the default 1
417 second. The interval argument follows the syntax described in
418 PCPIntro(1), and in the simplest form may be an unsigned integer
419 (the implied units in this case are seconds). See also the -T and
420 -u options.
421
422 -T endtime, --finish=endtime
423 When reporting archived metrics, the report will be restricted to
424 those records logged before or at endtime. Refer to PCPIntro(1)
425 for a complete description of the syntax for endtime.
426
427 When used to define the runtime before pmrep will exit, if no sam‐
428 ples is given (see -s) then the number of reported samples depends
429 on interval (see -t). If samples is given then interval will be
430 adjusted to allow reporting of samples during runtime. In case
431 all of -T, -s, and -t are given, endtime determines the actual
432 time pmrep will run.
433
434 -u, --no-interpol
435 When reporting archived metrics, by default values are reported
436 according to the selected sample interval (-t option), not accord‐
437 ing to the actual record interval in an archive. To this effect
438 PCP interpolates the values to be reported based on the records in
439 the archive. With the -u option uninterpolated reporting is
440 enabled, every recorded value for the selected metrics is reported
441 and the requested sample interval (-t) is ignored.
442
443 So for example, if a PCP archive contains recorded values for
444 every 10 seconds and the requested sample interval is 1 hour, by
445 default pmrep will use an interpolation scheme to compute the val‐
446 ues of the requested metrics from the values recorded in the prox‐
447 imity of these requested metrics and values for every 1 hour are
448 reported. With -u every record every 10 seconds are reported as
449 such (the reported values are still subject to rate conversion,
450 use -r or -R to disable).
451
452 -U, --no-unit-info
453 Omit unit information from headers.
454
455 -v, --omit-flat
456 Omit single-valued ``flat'' metrics from reporting, only consider
457 set-valued metrics (i.e., metrics with multiple values) for
458 reporting. See -i and -I.
459
460 -V, --version
461 Display version number and exit.
462
463 -w width, --width=width
464 Set the stdout output column width. Strings will be truncated to
465 this width. The default width is the shortest that can fit the
466 metric text label, the forced minimum is 3. This option will not
467 override possible per-metric specifications.
468
469 -W width, --width-force=width
470 Like -w but this option will override per-metric specifications.
471
472 -x, --extended-header
473 Print extended header.
474
475 -X label, --colxrow=label
476 Swap columns and rows in stdout output, reporting one instance per
477 line, using label as the text label for instance column (set to an
478 empty string "" to enable swapping without a specific text label).
479 This is convenient to allow easily using grep(1) to filter results
480 or to more closely mimic other utilities. See also -i and -6.
481
482 -y scale, --time-scale=scale
483 Unit/scale for time metrics, possible values include nanosec, ns,
484 microsec, us, millisec, ms, and so forth up to hour, hr. This
485 option will not override possible per-metric specifications. See
486 also pmParseUnitsStr(3).
487
488 -Y scale, --time-scale-force=scale
489 Like -y but this option will override per-metric specifications.
490
491 -z, --hostzone
492 Use the local timezone of the host that is the source of the per‐
493 formance metrics, as identified by either the -h or the -a
494 options. The default is to use the timezone of the local host.
495
496 -Z timezone, --timezone=timezone
497 Use timezone for the date and time. Timezone is in the format of
498 the environment variable TZ as described in environ(7). Note that
499 when including a timezone string in output, ISO 8601 -style UTC
500 offsets are used (so something like -Z EST+5 will become UTC-5).
501
502 -?, --help
503 Display usage message and exit.
504
506 The following examples use the standard PCP facilities for collecting
507 the metric values, no external utilities are needed. The referenced
508 colon-starting metricsets are part of the system pmrep.conf file.
509
510 Display network interface metrics on the local host:
511 $ pmrep network.interface.total.bytes
512
513 Display all outgoing network metrics for the wlan0 interface:
514 $ pmrep -i wlan0 -v network.interface.out
515
516 Display timestamped vmstat(8) like information using megabytes instead
517 of kilobytes and also include the number of inodes used (tab completes
518 available metrics and after a colon metricsets with bash and zsh):
519 $ pmrep -p -B MB :vmstat vfs.inodes.count
520
521 Display per-device disk reads and writes from the host server1 using
522 two seconds interval and sadf(1) like CSV output format:
523 $ pmrep -h server1 -t 2s -o csv -k disk.dev.read disk.dev.write
524
525 Display processes using at least 100MB of memory using dynamic headers:
526 $ pmrep -b MB --limit-filter 100 --dynamic-header proc.memory.rss
527
528 Display the predefined set of metrics from the default pmrep.conf(5)
529 containing information about I/O issued by current firefox process(es):
530 $ pmrep -i '.*firefox.*' :proc-io
531
532 Display the three most CPU-using processes:
533 $ pmrep -1gUJ 3 proc.hog.cpu
534
535 Display sar -w and sar -W like information at the same time from the
536 PCP archive ./20150921.09.13 showing values recorded between 3 - 5 PM:
537 $ pmrep -a ./20150921.09.13 -S @15:00 -T @17:00 :sar-w :sar-W
538
539 Record most relevant CPU, memory, and I/O related information about
540 every Java process on the system, present and future, to an archive ./a
541 on one minute interval at every full minute in a background process:
542 $ pmrep --daemonize -A 1m -t 1m -i '.*java.*' -j -o archive -F ./a \
543 :proc-info :proc-cpu :proc-mem :proc-io
544
545 Record all 389 Directory Server, XFS file system, and CPU/memory/disk
546 metrics every five seconds for five minutes to a PCP archive ./a:
547 $ pmrep -t 5s -T 5m -o archive -F ./a ds389 xfs kernel.all.cpu mem disk
548
549 Record process memory and I/O information for those processes which are
550 the three most memory-consuming processes:
551 $ pmrep -o archive -F ./a -J 3 -N proc.memory.rss proc.memory proc.io
552
554 pmrep.conf
555 pmrep configuration file (see -c)
556
557 $PCP_SYSCONF_DIR/pmrep/pmrep.conf
558 system provided pmrep configuration file
559
561 Environment variables with the prefix PCP_ are used to parameterize the
562 file and directory names used by PCP. On each installation, the file
563 /etc/pcp.conf contains the local values for these variables. The
564 $PCP_CONF variable may be used to specify an alternative configuration
565 file, as described in pcp.conf(5).
566
567 For environment variables affecting PCP tools, see pmGetOptions(3).
568
570 mkaf(1), PCPIntro(1), pcp(1), pcp-atop(1), pcp2elasticsearch(1),
571 pcp2graphite(1), pcp2influxdb(1), pcp2json(1), pcp2spark(1),
572 pcp2xlsx(1), pcp2xml(1), pcp2zabbix(1), pmcd(1), pmchart(1), pmdiff(1),
573 pmdumplog(1), pmdumptext(1), pminfo(1), pmiostat(1), pmlogextract(1),
574 pmlogsummary(1), pmprobe(1), pmstat(1), pmval(1), sadf(1), sar(1),
575 pmGetOptions(3), pmSpecLocalPMDA(3), pmLoadDerivedConfig(3), pmParseU‐
576 nitsStr(3), pmRegisterDerived(3), strftime(3), LOGARCHIVE(5),
577 pcp.conf(5), PMNS(5), pmrep.conf(5), environ(7) and vmstat(8).
578
579
580
581Performance Co-Pilot PCP PMREP(1)