'\"macro stdmacro .\" .\" Copyright (C) 2015-2021 Marko Myllynen .\" Copyright (c) 2016-2018 Red Hat. .\" .\" This program is free software; you can redistribute it and/or modify it .\" under the terms of the GNU General Public License as published by the .\" Free Software Foundation; either version 2 of the License, or (at your .\" option) any later version. .\" .\" This program is distributed in the hope that it will be useful, but .\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY .\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" for more details. .\" .\" .TH PMREP 1 "PCP" "Performance Co-Pilot" .SH NAME \f3pmrep\f1 \- performance metrics reporter .SH SYNOPSIS \fBpmrep\fP [\fB\-12357CdgGHIjkLmnprRuUvVxz?\fP] [\fB\-4\fP \fIaction\fP] [\fB\-6\fP \fIsort-metric\fP] [\fB\-8\fP|\fB\-9\fP \fIlimit\fP] [\fB\-a\fP \fIarchive\fP] [\fB\-A\fP \fIalign\fP] [\fB\-\-archive\-folio\fP \fIfolio\fP] [\fB\-b\fP|\fB\-B\fP \fIspace-scale\fP] [\fB\-c\fP \fIconfig\fP] [\fB\-\-container\fP \fIcontainer\fP] [\fB\-\-daemonize\fP] [\fB\-e\fP \fIderived\fP] [\fB\-E\fP \fIlines\fP] [\fB\-f\fP \fIformat\fP] [\fB\-F\fP \fIoutfile\fP] [\fB\-h\fP \fIhost\fP] [\fB\-i\fP \fIinstances\fP] [\fB\-\-include\-texts\fP] [\fB\-J\fP \fIrank\fP] [\fB\-K\fP \fIspec\fP] [\fB\-l\fP \fIdelimiter\fP] [\fB\-N\fP \fIpredicate\fP] [\fB\-\-no\-inst\-info\fP] [\fB\-o\fP \fIoutput\fP] [\fB\-O\fP \fIorigin\fP] [\fB\-P\fP|\fB\-0\fP \fIprecision\fP] [\fB\-q\fP|\fB\-Q\fP \fIcount-scale\fP] [\fB\-s\fP \fIsamples\fP] [\fB\-S\fP \fIstarttime\fP] [\fB\-t\fP \fIinterval\fP] [\fB\-T\fP \fIendtime\fP] [\fB\-w\fP|\fB\-W\fP \fIwidth\fP] [\fB\-X\fP \fIlabel\fP] [\fB\-y\fP|\fB\-Y\fP \fItime-scale\fP] [\fB\-Z\fP \fItimezone\fP] \fImetricspec\fP [...] .SH DESCRIPTION .de EX .in +0.5i .ie t .ft CB .el .ft B .ie t .sp .5v .el .sp .ta \\w' 'u*8 .nf .. .de EE .fi .ie t .sp .5v .el .sp .ft R .in .. .B pmrep is a customizable performance metrics reporting tool. Any available performance metric, live or archived, system and/or application, can be selected for reporting using one of the output alternatives listed below together with applicable formatting options. .PP .B pmrep collects selected metric values through the facilities of the Performance Co-Pilot (PCP), see .BR PCPIntro (1). The metrics to be reported are specified on the command line, in configuration files, or both. Metrics can be automatically converted and scaled using the PCP facilities, either by default or by per-metric scaling specifications. In addition to the existing metrics, derived metrics can be defined using the arithmetic expressions described in .BR pmRegisterDerived (3). .PP A wide range of metricsets (see below) is included by default, providing reports on per-process details, NUMA performance, mimicking other tools like .BR sar(1) and more, see the \fBpmrep\fP configuration files in .I $PCP_SYSCONF_DIR/pmrep (typically \fI/etc/pcp/pmrep\fP) for details. Tab completion for options, metrics, and metricsets is available for bash and zsh. .PP Unless directed to another host by the .B \-h option, .B pmrep will contact the Performance Metrics Collector Daemon (PMCD, see .BR pmcd (1)) on the local host. .PP The .B \-a option causes .B pmrep to use the specified set of archives rather than connecting to a PMCD. The .B \-a and .B \-h options are mutually exclusive. .PP The .B \-L option causes .B pmrep to use a local context to collect metrics from DSO PMDAs (Performance Metrics Domain Agents, ``plugins'') on the local host without PMCD. Only some metrics are available in this mode. The .BR \-a , .BR \-h , and .B \-L options are mutually exclusive. .PP The metrics of interest are named in the .I metricspec argument(s). If a metricspec specifies a non-leaf node in the Performance Metrics Name Space (PMNS), then .B pmrep will recursively descend the PMNS and report on all leaf nodes (i.e., metrics) for that metricspec. Use .BR pminfo (1) to list all the metrics (PMNS lead nodes) and their descriptions. .PP A .I metricspec has three different forms. First, on the command line it can start with a colon (``:'') to indicate a .I metricset to be read from .B pmrep configuration files (see .B \-c and .BR pmrep.conf (5)), which may then consist of any number of metrics. Second, a .I metricspec starting with non-colon specifies a PMNS node as described above, optionally followed by metric output formatting definitions. This so-called .I compact form of a metricspec is defined as follows: .PP .in 0.5i .ft CR .nf metric[,label[,instances[,unit/scale[,type[,width[,precision[,limit]]]]]]] .fi .ft R .in .PP A valid PMNS node .RI ( metric ) is mandatory. It may be followed by a text .I label used with .I stdout output. The optional .I instances definition restricts .I csv and .I stdout reporting to the specified instances of the metric so non-matching instances will be filtered out (see .BR -i ). An optional .I unit/scale is applicable for dimension-compatible, non-string metrics. See below for supported .I unit/scale specifications. By default, cumulative counter metrics are converted to rates, an optional .I type can be set to .B raw to disable this rate conversion. For .IR stdout output a numeric .I width can be used to set the width of the output column for this metric. Too wide strings in the output will be truncated to fit the column. A metric-specific .I precision can be provided for numeric non-integer output values. Lastly, a metric-specific .I limit can be set for filtering out numeric values per the limit. .PP As a special case for metrics that are counters with time units (nanoseconds to hours), the .I unit/scale can be used to change the default reporting (for example, milliseconds / second) to normalize to the range zero to one by setting this to .B sec (see also .B \-y and .BR \-Y ). .PP The following .I metricspec requests the metric .B kernel.all.sysfork to be reported under the text label .BR forks , converting to the metric default rate count/s in an .B 8 wide column. Although the definitions in this .I compact form are optional, they must always be provided in the order specified above, thus the commas. .PP .in 1.5i .ft CR .nf kernel.all.sysfork,forks,,,,8 .fi .ft R .in .PP The third form of a metricspec, .IR "verbose form" , is described and valid only in .BR pmrep.conf (5). .PP Derived metrics are specified like regular PMNS leaf node metrics. .PP Options via environment values (see .BR pmGetOptions (3)) override the corresponding built-in default values (if any). Configuration file options override the corresponding environment variables (if any). Command line options override the corresponding configuration file options (if any). .SH OPTIONS The available command line options are: .TP 5 \fB\-0\fR \fIprecision\fR, \fB\-\-precision\-force\fR=\fIprecision\fR Like .B \-P but this option \fIwill\fP override per-metric specifications. .TP \fB\-1\fR, \fB\-\-dynamic\-header\fR Print a new dynamically adjusted header every time changes in the availability of metric and instance values occur. By default a static header that never changes is printed once. See also .BR \-4 , .BR \-7 , and .BR \-E . .TP \fB\-2\fR, \fB\-\-overall\-rank\fR Perform overall ranking of instances in archive. By default ranking (see .BR \-J ) and reporting happens on each interval. With this option all instances and values are ranked before a summary is reported. See .BR pmlogsummary (1) for further archive summary reporting alternatives, including averages and peak times for values. .TP \fB\-3\fR, \fB\-\-overall\-rank\-alt\fR Like .B \-2 but print metric instances in \fBpmrep\fP \fImetricspec\fP format, to allow easily selecting the instances for further investigation. .TP \fB\-4\fR \fIaction\fR, \fB\-\-names\-change\fR=\fIaction\fR Specify which .I action to take on receiving a metric names change event during sampling. These events occur when a PMDA discovers new metrics sometime after starting up, and informs running client tools like .BR pmrep . Valid values for .I action are \fBupdate\fP (refresh metrics being sampled), \fBignore\fP (do nothing \- the default behaviour) and \fBabort\fP (exit the program if such an event occurs). \fIupdate\fP implies \fB\-\-dynamic\-header\fP. .TP \fB\-5\fR, \fB\-\-ignore\-unknown\fR Silently ignore any metric name that cannot be resolved. At least one metric must be found for the tool to start. .TP \fB\-6\fR, \fB\-\-sort\-metric\fR=\fIsort-metric\fR Specify a sort reference metric to sort output by values with .BR \-X . By default sorting order is descending, prepending the metric name with the minus sign (``-'') will change the order to be ascending. See also .BR \-J " and " .BR \-N . .TP \fB\-7\fR, \fB\-\-fixed\-header\fR With \fB\-X\fP print a fixed header once (unless using \fB\-E\fP) including all metrics being reported. Unlike with the default (static) header, only instances with values available are reported. Unlike with the dynamic header, the header is not updated even if values for some metrics later become (un)available. See also .BR \-1 " and " .BR \-E . .TP \fB\-8\fR \fIlimit\fR, \fB\-\-limit\-filter\fR=\fIlimit\fR Limit results to instances with values above/below .IR limit . A positive integer will include instances with values at or above the limit in reporting. A negative integer will include instances with values at or below the limit in reporting. A value of zero performs no limit filtering. This option will \fInot\fP override possible per-metric specifications. See also .BR \-J " and " .BR \-N . .TP \fB\-9\fR \fIlimit\fR, \fB\-\-limit\-filter\-force\fR=\fIlimit\fR Like .B \-8 but this option \fIwill\fP override per-metric specifications. .TP \fB\-a\fR \fIarchive\fR, \fB\-\-archive\fR=\fIarchive\fR Performance metric values are retrieved from the set of Performance Co-Pilot (PCP) archive files identified by the .I archive argument, which is a comma-separated list of names, each of which may be the base name of an archive or the name of a directory containing one or more archives. See also .BR \-u . .TP \fB\-A\fR \fIalign\fR, \fB\-\-align\fR=\fIalign\fR Force the initial sample to be aligned on the boundary of a natural time unit .IR align . Refer to .BR PCPIntro (1) for a complete description of the syntax for .IR align . .TP \fB\-\-archive\-folio\fR=\fIfolio\fR Read metric source archives from the PCP archive .I folio created by tools like .BR pmchart (1) or, less often, manually with .BR mkaf (1). .TP \fB\-b\fR \fIscale\fR, \fB\-\-space\-scale\fR=\fIscale\fR .I Unit/scale for space (byte) metrics, possible values include .BR bytes , .BR Kbytes , .BR KB , .BR Mbytes , .BR MB , and so forth. This option will \fInot\fP override possible per-metric specifications. See also .BR pmParseUnitsStr (3). .TP \fB\-B\fR \fIscale\fR, \fB\-\-space\-scale\-force\fR=\fIscale\fR Like .B \-b but this option \fIwill\fP override per-metric specifications. .TP \fB\-c\fR \fIconfig\fR, \fB\-\-config\fR=\fIconfig\fR Specify the .I config file or directory to use. In case \fIconfig\fP is a directory all files in it ending \fB.conf\fP will be included. The default is the first found of: .IR ./pmrep.conf , .IR $HOME/.pmrep.conf , .IR $HOME/pcp/pmrep.conf , .IR $PCP_SYSCONF_DIR/pmrep/pmrep.conf , and .IR $PCP_SYSCONF_DIR/pmrep . See .BR pmrep.conf (5). .TP \fB\-\-container\fR=\fIcontainer\fR Fetch performance metrics from the specified .IR container , either local or remote (see .BR \-h ). .TP \fB\-C\fR, \fB\-\-check\fR Exit before reporting any values, but after parsing the configuration and metrics and printing possible headers. .TP \fB\-d\fR, \fB\-\-delay\fR When replaying from an archive, this option requests that the prevailing real-time delay be applied between samples (see .BR \-t ) to effect a pause, rather than the default behaviour of replaying at full speed. .TP .B \-\-daemonize Daemonize on startup. .TP \fB\-e\fR \fIderived\fR, \fB\-\-derived\fR=\fIderived\fR Specify .I derived performance metrics. If .I derived starts with a slash (``/'') or with a dot (``.'') it will be interpreted as a PCP derived metrics configuration file, otherwise it will be interpreted as comma- or semicolon-separated derived metric expressions. For complete description of derived metrics and PCP derived metrics configuration files see .BR pmLoadDerivedConfig (3) and .BR pmRegisterDerived (3). Alternatively, using .BR pmrep.conf (5) configuration syntax allows defining derived metrics as part of metricsets. .TP \fB\-E\fR \fIlines\fR, \fB\-\-repeat\-header\fR=\fIlines\fR Repeat the header every .I lines of output. When not using \fB\-1\fR or \fB\-7\fR use \fBauto\fR to repeat the header based on terminal height. See also .B \-1 and .BR \-7 . .TP \fB\-f\fR \fIformat\fR, \fB\-\-timestamp\-format\fR=\fIformat\fR Use the .I format string for formatting the timestamp. The format will be used with Python's .B datetime.strftime method which is mostly the same as that described in .BR strftime (3). An empty .I format string (i.e., "") will remove the timestamps from the output. Defaults to .B %H:%M:%S when using the .I stdout output target. Defaults to .B "%Y-%m-%d %H:%M:%S" when using the .I csv output target. .TP \fB\-F\fR \fIoutfile\fR, \fB\-\-output\-file\fR=\fIoutfile\fR Specify the output file .IR outfile . See .BR \-o . .TP \fB\-g\fR, \fB\-\-separate\-header\fR Output the column number and complete metric information, one-per-line, before printing the metric values. .TP \fB\-G\fR, \fB\-\-no\-globals\fR Do not include global metrics in reporting (see .BR pmrep.conf (5)). .TP \fB\-h\fR \fIhost\fR, \fB\-\-host\fR=\fIhost\fR Fetch performance metrics from .BR pmcd (1) on .IR host , rather than from the default localhost. .TP \fB\-H\fR, \fB\-\-no\-header\fR Do not print any headers. .TP \fB\-i\fR \fIinstances\fR, \fB\-\-instances\fR=\fIinstances\fR Retrieve and report only the specified metric .IR instances . By default all initially present instances are reported, except when writing an archive (see .BR \-o ), where also all future instances will be reported. .RS .PP The specified .I instances are filtered from the initially present instances when the tool is starting up. Thus instances which would match the filter appearing after the tool has started up will not be reported, use .B \-j to change this. .PP This is a global option that is used for all set-valued metrics unless a metric-specific instance filter is provided as part of a .IR metricspec . By default single-valued ``flat'' metrics without instances are still reported as usual, use .B \-v to change this. .PP .I instances is a comma-separated list of one or more instance filter specifications. Filters containing commas or whitespace must be quoted with single (') or double (") quotes. Note that as part of a .I metricspec on command line a list with more than one filter both the list and each filter must be quoted as shown below. It is also possible to define a single filter with bars (|) as instance separating regex in order to make quoting easier, see below. .PP Multiple .B \-i options are allowed as an alternative way of specifying more than one non-metric-specific instance filters. .PP An individual instance filter can be one of the following: .TP 10 .I name Full instance name. For example, \fBsda\fP for \fIdisk.dev\fP instances or \fBeth0\fP for \fInetwork.interface\fP instances. .TP .I PID Process ID for \fIproc\fP instances. .TP .I command Base name of a process for \fIproc\fP instances. For example, \fBpmcd\fP would match all .BR pmcd (1) processes regardless of their path or PID. .TP .I regex Regular expression. For example, \fB.*python.*\fP would match all instances having the string \fBpython\fP as part of their instance name, meaning that this would match all Python processes regardless of their path, PID, or version. .PP As an example, the following would report the same instances: .EX $ pmrep \-i '. minute' kernel.all.load $ pmrep \-i '1 minute','5 minute' kernel.all.load $ pmrep \-i "'1 minute','5 minute'" kernel.all.load $ pmrep \-i '1 minute' \-i '5 minute' kernel.all.load $ pmrep kernel.all.load,,"'1 minute','5 minute'" $ pmrep kernel.all.load,,'1 minute|5 minute' .EE .PP However, this would report only the 1-minute instance: .EX $ pmrep \-i '1 minute','5 minute' kernel.all.load,,'1 minute' .EE .PP And this would report all instances (due to per-metric regex): .EX $ pmrep \-i '1 minute','5 minute' 'kernel.all.load,,.*' .EE .RE .TP \fB\-I\fR, \fB\-\-ignore\-incompat\fR Ignore incompatible metrics. By default incompatible metrics (that is, their type is unsupported or they cannot be scaled as requested) will cause .B pmrep to terminate with an error message. With this option all incompatible metrics are silently omitted from reporting. This may be especially useful when requesting non-leaf nodes of the PMNS tree for reporting. .TP \fB\-\-include\-texts\fR When writing a PCP archive, include PCP metric help texts in the created archive. .TP \fB\-j\fR, \fB\-\-live\-filter\fR Perform instance live filtering. This allows capturing all named instances even if processes are restarted at some point (unlike without live filtering). Performing live filtering over a huge number of instances will add some internal overhead so a bit of user caution is advised. See also .BR \-1 " and " .BR \-n . .TP \fB\-J\fR \fIrank\fR, \fB\-\-rank\fR=\fIrank\fR Limit results to highest/lowest .IR rank ed instances of set-valued metrics. A positive integer will include highest valued instances in reporting. A negative integer will include lowest valued instances in reporting. A value of zero performs no ranking. Ranking does not imply sorting, see .BR \-6 . See also .BR \-2 and .BR \-8 . .TP \fB\-k\fR, \fB\-\-extended\-csv\fR Write extended CSV output, similar to .BR sadf (1). .TP \fB\-K\fR \fIspec\fR, \fB\-\-spec\-local\fR=\fIspec\fR When fetching metrics from a local context (see .BR \-L ), the .B \-K option may be used to control the DSO PMDAs that should be made accessible. The .I spec argument conforms to the syntax described in .BR pmSpecLocalPMDA (3). More than one .B \-K option may be used. .TP \fB\-l\fR \fIdelimiter\fR, \fB\-\-delimiter\fR=\fIdelimiter\fR Specify the .I delimiter that separates each column of .I csv or .I stdout output. The default for .I stdout is two spaces (`` '') and comma (``,'') for .IR csv . When using a non-whitespace delimiter, all instances of the delimiter in string values will be replaced by the underscore (``_'') character. .TP \fB\-L\fR, \fB\-\-local\-PMDA\fR Use a local context to collect metrics from DSO PMDAs on the local host without PMCD. See also .BR \-K . .TP \fB\-m\fR, \fB\-\-include\-labels\fR Include PCP metric labels in the output. .TP \fB\-n\fR, \fB\-\-invert\-filter\fR Perform ranking before live filtering. By default instance live filtering (when requested, see .BR \-j ) happens before instance ranking (when requested, see .BR \-J ). With this option the logic is inverted and ranking happens before live filtering. .TP \fB\-N\fR \fIpredicate\fR, \fB\-\-predicate\fR=\fIpredicate\fR Specify a comma-separated list of .I predicate filter reference metrics. By default ranking (see .BR \-J ) happens for each metric individually. With predicates, ranking is done only for the specified predicate metrics. When reporting, rest of the metrics sharing the same .I instance domain (see .BR PCPIntro (1)) as the predicate will include only the highest/lowest ranking instances of the corresponding predicate. Ranking does not imply sorting, see .BR \-6 . .RS .PP So for example, using \fBproc.memory.rss\fP (resident memory size of process) as the .I predicate metric together with \fBproc.io.total_bytes\fP and \fBmem.util.used\fP as metrics to be reported, only the processes using most/least (as per .BR \-J ) memory will be included when reporting total bytes written by processes. Since \fBmem.util.used\fP is a single-valued metric (thus not sharing the same instance domain as the process related metrics), it will be reported as usual. .RE .TP \fB\-\-no\-inst\-info\fR Omit instance information from headers. Not applicable with separate header (see \fB\-g\fR). .TP \fB\-o\fR \fIoutput\fR, \fB\-\-output\fR=\fIoutput\fR Use .I output target for reporting. The default target is .IR stdout . The available output target alternatives are: .RS .TP 2 .I archive Record metrics into a PCP archive which can later be replayed with PCP tools, including .B pmrep itself. See .BR LOGARCHIVE (5) and .BR PCPIntro (1) for details about PCP archive files. Requires .BR \-F . .TP .I csv Print metrics in CSV format (subject to formatting options). .TP .I stdout Print metrics to stdout (format subject to formatting options). .RE .TP \fB\-O\fR \fIorigin\fR, \fB\-\-origin\fR=\fIorigin\fR When reporting archived metrics, start reporting at .I origin within the time window (see .B \-S and .BR \-T ). Refer to .BR PCPIntro (1) for a complete description of the syntax for .IR origin . .TP \fB\-p\fR, \fB\-\-timestamps\fR Print timestamps. By default no timestamps are printed. .TP \fB\-P\fR \fIprecision\fR, \fB\-\-precision\fR=\fIprecision\fR Use .I precision for numeric non-integer output values. If the value is too wide for its column width, .I precision is reduced one by one until the value fits, or not printed at all if it does not. The default is to use 3 decimal places (when applicable). This option will \fInot\fP override possible per-metric specifications. .TP \fB\-q\fR \fIscale\fR, \fB\-\-count\-scale\fR=\fIscale\fR .I Unit/scale for count metrics, possible values include .BR "count x 10^\-1" , .BR "count" , .BR "count x 10" , .BR "count x 10^2" , and so forth from .B 10^\-8 to .BR 10^7 . .\" https://bugzilla.redhat.com/show_bug.cgi?id=1264124 (These values are currently space-sensitive.) This option will \fInot\fP override possible per-metric specifications. See also .BR pmParseUnitsStr (3). .TP \fB\-Q\fR \fIscale\fR, \fB\-\-count\-scale\-force\fR=\fIscale\fR Like .B \-q but this option \fIwill\fP override per-metric specifications. .TP \fB\-r\fR, \fB\-\-raw\fR Output raw metric values, do not convert cumulative counters to rates. When writing archives, raw values are always used. This option \fIwill\fP override possible per-metric specifications. .TP \fB\-R\fR, \fB\-\-raw\-prefer\fR Like .B \-r but this option will \fInot\fP override per-metric specifications. .TP \fB\-s\fR \fIsamples\fR, \fB\-\-samples\fR=\fIsamples\fR The .I samples argument defines the number of samples to be retrieved and reported. If .I samples is 0 or .B \-s is not specified, .B pmrep will sample and report continuously (in real time mode) or until the end of the set of PCP archives (in archive mode). See also .BR \-T . .TP \fB\-S\fR \fIstarttime\fR, \fB\-\-start\fR=\fIstarttime\fR When reporting archived metrics, the report will be restricted to those records logged at or after .IR starttime . Refer to .BR PCPIntro (1) for a complete description of the syntax for .IR starttime . .TP \fB\-t\fR \fIinterval\fR, \fB\-\-interval\fR=\fIinterval\fR Set the reporting .I interval to something other than the default 1 second. The .I interval argument follows the syntax described in .BR PCPIntro (1), and in the simplest form may be an unsigned integer (the implied units in this case are seconds). See also the .B \-T and .B \-u options. .TP \fB\-T\fR \fIendtime\fR, \fB\-\-finish\fR=\fIendtime\fR When reporting archived metrics, the report will be restricted to those records logged before or at .IR endtime . Refer to .BR PCPIntro (1) for a complete description of the syntax for .IR endtime . .RS .PP When used to define the runtime before \fBpmrep\fP will exit, if no \fIsamples\fP is given (see \fB\-s\fP) then the number of reported samples depends on \fIinterval\fP (see \fB\-t\fP). If .I samples is given then .I interval will be adjusted to allow reporting of .I samples during runtime. In case all of .BR \-T , .BR \-s , and .B \-t are given, .I endtime determines the actual time .B pmrep will run. .RE .TP \fB\-u\fR, \fB\-\-no\-interpol\fR When reporting archived metrics, by default values are reported according to the selected sample interval (\c .B \-t option), not according to the actual record interval in an archive. To this effect PCP interpolates the values to be reported based on the records in the archive. With the .B \-u option uninterpolated reporting is enabled, every recorded value for the selected metrics is reported and the requested sample interval (\c .BR \-t ) is ignored. .RS .PP So for example, if a PCP archive contains recorded values for every 10 seconds and the requested sample interval is 1 hour, by default .B pmrep will use an interpolation scheme to compute the values of the requested metrics from the values recorded in the proximity of these requested metrics and values for every 1 hour are reported. With .B \-u every record every 10 seconds are reported as such (the reported values are still subject to rate conversion, use .B \-r or .B \-R to disable). .RE .TP \fB\-U\fR, \fB\-\-no\-unit\-info\fR Omit unit information from headers. .TP \fB\-v\fR, \fB\-\-omit\-flat\fR Report only set-valued metrics with instances (e.g. disk.dev.read) and omit single-valued ``flat'' metrics without instances (e.g. kernel.all.sysfork). See .B \-i and .BR \-I . .TP \fB\-V\fR, \fB\-\-version\fR Display version number and exit. .TP \fB\-w\fR \fIwidth\fR, \fB\-\-width\fR=\fIwidth\fR Set the .I stdout output column .IR width . Strings will be truncated to this width. The default .I width is the shortest that can fit the metric text label, the forced minimum is 3. This option will \fInot\fP override possible per-metric specifications. .TP \fB\-W\fR \fIwidth\fR, \fB\-\-width\-force\fR=\fIwidth\fR Like .B \-w but this option \fIwill\fP override per-metric specifications. .TP \fB\-x\fR, \fB\-\-extended\-header\fR Print extended header. .TP \fB\-X\fR \fIlabel\fR, \fB\-\-colxrow\fR=\fIlabel\fR Swap columns and rows in \fIstdout\fP output, reporting one instance per line, using \fIlabel\fP as the text label for the instance column. Use an empty string ("") to enable swapping without a specific column label. This change in output allows using .BR grep (1) to filter results or to more closely mimic other tools. See also .BR \-i " and " .BR \-6 . .TP \fB\-y\fR \fIscale\fR, \fB\-\-time\-scale\fR=\fIscale\fR .I Unit/scale for time metrics, possible values include .BR nanosec , .BR ns , .BR microsec , .BR us , .BR millisec , .BR ms , and so forth up to .BR hour , .BR hr . This option will \fInot\fP override possible per-metric specifications. See also .BR pmParseUnitsStr (3). .TP \fB\-Y\fR \fIscale\fR, \fB\-\-time\-scale\-force\fR=\fIscale\fR Like .B \-y but this option \fIwill\fP override per-metric specifications. .TP \fB\-z\fR, \fB\-\-hostzone\fR Use the local timezone of the host that is the source of the performance metrics, as identified by either the .B \-h or the .B \-a options. The default is to use the timezone of the local host. .TP \fB\-Z\fR \fItimezone\fR, \fB\-\-timezone\fR=\fItimezone\fR Use .I timezone for the date and time. .I Timezone is in the format of the environment variable .B TZ as described in .BR environ (7). Note that when including a timezone string in output, ISO 8601 -style UTC offsets are used (so something like \-Z EST+5 will become UTC-5). .TP \fB\-?\fR, \fB\-\-help\fR Display usage message and exit. .SH EXAMPLES The following examples use the standard PCP facilities for collecting the metric values, no external utilities are needed. The referenced colon-starting .I metricsets are part of the default \fBpmrep\fR configuration. With bash and zsh tab completes available options, metrics, and after a colon metricsets. .PP Display network interface metrics on the local host: .RS +4 .ft B .nf $ pmrep network.interface.total.bytes .fi .ft P .RE .PP Display all outgoing network metrics for the .I wlan0 interface: .RS +4 .ft B .nf $ pmrep \-i wlan0 \-v network.interface.out .fi .ft P .RE .PP Display the slab total usage (in MB) of two specific slab instances: .RS +4 .ft B .nf $ pmrep mem.slabinfo.slabs.total_size,,'kmalloc\-4k|xfs_inode',MB .fi .ft P .RE .PP Display timestamped .BR vmstat (8) like information using megabytes instead of kilobytes and also include the number of inodes used: .RS +4 .ft B .nf $ pmrep \-p \-B MB :vmstat vfs.inodes.count .fi .ft P .RE .PP Display per-device disk reads and writes from the host .I server1 using two seconds interval and .BR sadf (1) like CSV output format: .RS +4 .ft B .nf $ pmrep \-h server1 \-t 2s \-o csv \-k disk.dev.read disk.dev.write .fi .ft P .RE .PP Display processes using at least 100MB of memory using dynamic headers, additionally use .B \-g to display instance (process) names in full: .RS +4 .ft B .nf $ pmrep \-b MB \-\-limit\-filter 100 \-\-dynamic\-header proc.memory.rss .fi .ft P .RE .PP Display the predefined set of metrics from the default .BR pmrep.conf (5) containing details about I/O requests by current .IR pmlogger " process(es):" .RS +4 .ft B .nf $ pmrep \-gp \-i pmlogger :proc\-io .fi .ft P .RE .PP Display the three most CPU-using processes: .RS +4 .ft B .nf $ pmrep \-1gUJ 3 proc.hog.cpu .fi .ft P .RE .PP Display .B sar \-w and .B sar \-W like information at the same time from the PCP archive .I ./20150921.09.13 showing values recorded between 3 - 5 PM: .RS +4 .ft B .nf $ pmrep \-a ./20150921.09.13 \-S @15:00 \-T @17:00 :sar\-w :sar\-W .fi .ft P .RE .PP Record most relevant CPU, memory, and I/O related information about every Java process on the system, present and future, to an archive .I ./a on one minute interval at every full minute in a background process: .RS +4 .ft B .nf $ pmrep \-\-daemonize \-A 1m \-t 1m \-i '.*java.*' \-j \-o archive \-F ./a \\ :proc\-info :proc\-cpu :proc\-mem :proc\-io .fi .ft P .RE .PP Record all 389 Directory Server, XFS file system, and CPU/memory/disk metrics every five seconds for five minutes to a PCP archive .IR ./a : .RS +1 .ft B .nf $ pmrep \-t 5s \-T 5m \-o archive \-F ./a ds389 xfs kernel.all.cpu mem disk .fi .ft P .RE .PP Record process memory and I/O information for those processes which are the three most memory-consuming processes: .RS +1 .ft B .nf $ pmrep \-o archive \-F ./a \-J 3 \-N proc.memory.rss proc.memory proc.io .fi .ft P .RE .SH FILES .TP 5 .I pmrep.conf \fBpmrep\fP configuration file (see \fB\-c\fP) .TP .I \f(CR$PCP_SYSCONF_DIR\fP/pmrep/*.conf system provided default \fBpmrep\fP configuration files .SH PCP ENVIRONMENT Environment variables with the prefix \fBPCP_\fP are used to parameterize the file and directory names used by PCP. On each installation, the file \fI/etc/pcp.conf\fP contains the local values for these variables. The \fB$PCP_CONF\fP variable may be used to specify an alternative configuration file, as described in \fBpcp.conf\fP(5). .PP For environment variables affecting PCP tools, see \fBpmGetOptions\fP(3). .SH SEE ALSO .BR PCPIntro (1), .BR mkaf (1), .BR pcp (1), .BR pcp\-atop (1), .BR pcp2elasticsearch (1), .BR pcp2graphite (1), .BR pcp2influxdb (1), .BR pcp2json (1), .BR pcp2spark (1), .BR pcp2xlsx (1), .BR pcp2xml (1), .BR pcp2zabbix (1), .BR pmcd (1), .BR pmchart (1), .BR pmdiff (1), .BR pmdumplog (1), .BR pmdumptext (1), .BR pminfo (1), .BR pmiostat (1), .BR pmlogextract (1), .BR pmlogsummary (1), .BR pmprobe (1), .BR pmstat (1), .BR pmval (1), .BR sadf (1), .BR sar (1), .BR pmGetOptions (3), .BR pmLoadDerivedConfig (3), .BR pmParseUnitsStr (3), .BR pmRegisterDerived (3), .BR pmSpecLocalPMDA (3), .BR strftime (3), .BR LOGARCHIVE (5), .BR pcp.conf (5), .BR pmrep.conf (5), .BR PMNS (5), .BR environ (7) and .BR vmstat (8).