Scroll to navigation

PMREP(1) General Commands Manual PMREP(1)

NAME

pmrep - performance metrics reporter

SYNOPSIS

pmrep [-1235CdgGHIjkLnprRuUvVxz?] [-4 action] [-6 sort-metric] [-8|-9 limit] [-a archive] [--archive-folio folio] [-A align] [-b|-B space-scale] [-c config] [--container container] [--daemonize] [-e derived] [-E lines] [-f format] [-F outfile] [-h host] [-i instances] [-J rank] [-K spec] [-l delimiter] [-N predicate] [-o output] [-O origin] [-P|-0 precision] [-q|-Q count-scale] [-s samples] [-S starttime] [-t interval] [-T endtime] [-w|-W width] [-X label] [-y|-Y time-scale] [-Z timezone] metricspec [...]

DESCRIPTION

pmrepis a customizable performance metrics reporting tool.Any available performance metric, live or archived, system and/orapplication, can be selected for reporting using one of the outputalternatives listed below together with applicable formatting options.

pmrepcollects the selected metric values through the facilities of thePerformance Co-Pilot (PCP), seePCPIntro(1).The metrics to be reported are specified on the command line,in a configuration file, 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 usingthe arithmetic expressions described inpmRegisterDerived(3).

Unless directed to another host by the-hoption,pmrepwill contact the Performance Metrics Collector Daemon (PMCD, seepmcd(1))on the local host.

The-aoption causespmrepto use the specified set of archive logs rather than connecting to a PMCD.The-aand-hoptions are mutually exclusive.

The-Loption causespmrepto use a local context to collect metrics from DSO PMDAs (PerformanceMetrics Domain Agents, ``plugins'') on the local host without PMCD.Only some metrics are available in this mode.The-a,-h,and-Loptions are mutually exclusive.

The metrics of interest are named in themetricspecargument(s).If a metricspec specifies a non-leaf node in thePerformance Metrics Name Space (PMNS), thenpmrepwill recursively descend the PMNS and report on all leaf nodes (i.e.,metrics) for that metricspec.(Use for examplepminfo(1)to list all the leaf nodes and their descriptions.)

Ametricspechas three different forms.First, on the command line it can start with a colon (``:'') to indicate ametricsetto be read from apmrepconfiguration file (seepmrep.conf(5))which can then consist of any number of metricspecs.Second, ametricspecstarting with non-colon specifies a PMNS node as described above,optionally followed by metric formatting definitions.This so-calledcompact formof a metricspec is defined as follows:


metric[,label[,instances[,unit/scale[,type[,width[,precision[,limit]]]]]]]

A valid PMNS node(metric)is mandatory.It can be followed by a textlabelused by supporting output targets (currently:stdout,see below).The optionalinstancesdefinition restrictscsvandstdoutreporting to the specified instances (so non-matching instanceswill be filtered).An optionalunit/scaleis applicable for dimension-compatible, non-string metrics.(See below for supportedunit/scalespecifications.)By default, cumulative counter metrics are converted to rates, an optionaltypecan be set torawto disable this rate conversion.For supporting output targets (currently:stdout)a numericwidthcan be used to set the width of the output column for this metric.Too-wide numeric values for output will not be printed (apart fromtrailing decimals, numeric values will never be silently truncated).Too-wide strings will be truncated.Then, a metric-specificprecisioncan be provided for numeric non-integer output values.Lastly, a metric-specificlimitcan be set for filtering numeric values per limit.

As a special case with metrics that are counters with time units(nanoseconds to hours), theunit/scalecan be used to change the default reporting (for example,milliseconds / second) to normalize to the range zero to oneby setting this tosec(see also-yand-Y).

The followingmetricspecrequests the metrickernel.all.sysforkto be reported under the text labelforks,converting to the default rate count/s in an8wide column.Although the definitions in thiscompact formare optional, they must always be provided in the order specified above.


kernel.all.sysfork,forks,,,,8

The third form of a metricspec,verbose form,is described and valid only inpmrep.conf(5).

Derived metrics are specified like PMNS leaf node metrics.

Options via environment values (seepmGetOptions(3))override the corresponding built-in default values (if any).Configuration file options override the correspondingenvironment variables (if any).Command line options override the corresponding configurationfile options (if any).

OPTIONS

The available command line options are:

-0 precision, --precision-force=precision
Like-Pbut this option will override per-metric specifications.
-1, --dynamic-header
Print a new dynamically adjusted header every time changes inavailability of metric and instance values occur.By default a static header that never changes is printed once.See also-Eand-4.
-2, --overall-rank
Perform overall ranking of instances in archive.By default ranking (see-J)and reporting happens on each interval.With this option all instances and values are rankedbefore a summary is reported.Seepmlogsummary(1)for further archive summary reporting alternatives,including averages and peak times for values.
-3, --overall-rank-alt
Like-2but print metric instances in pmrep metricspec format, to allow easily selecting the instances for further investigation.
-4 action, --names-change=action
Specify whichactionto take on receiving a metric names change event during sampling.These events occur when a PMDA discovers new metrics sometimeafter starting up, and informs running client tools likepmrep.Valid values foractionare update (refresh metrics being sampled), ignore (do nothing - the default behaviour) and abort (exit the program if such an event happens). update implies --dynamic-header.
-5, --ignore-unknown
Silently ignore any metric name that cannot be resolved.At least one metric must be found for the tool to start.
-6, --sort-metric=sort-metric
Specify a sort reference metric to sort output by values with-X.By default sorting order is descending, prepending the metricname with the minus sign (``-'') will change the order to be ascending.See also-J and -N.
-8 limit, --limit-filter=limit
Limit results to instances with values above/belowlimit.A positive integer will include instances with valuesat or above the limit in reporting.A negative integer will include instances with valuesat or below the limit in reporting.A value of zero performs no limit filtering.This option will not override possible per-metric specifications. See also -J and -N.
-9 limit, --limit-filter-force=limit
Like-8but this option will override per-metric specifications.
Performance metric values are retrieved from the set of PerformanceCo-Pilot (PCP) archive log files identified by the argumentarchive,which is a comma-separated list of names,each of which may be the base name of an archive or the name ofa directory containing one or more archives.See also-u.
--archive-folio=folio
Read metric source archives from the PCP archivefoliocreated by tools likepmchart(1)or, less often, manually withmkaf(1).
Force the initial sample to bealigned on the boundary of a natural time unitalign.Refer toPCPIntro(1)for a complete description of the syntax foralign.
Unit/scalefor space (byte) metrics, possible values includebytes,Kbytes,KB,Mbytes,MB,and so forth.This option will not override possible per-metric specifications. See also pmParseUnitsStr(3).
Like-bbut this option will override per-metric specifications.
Specify theconfigfile to use.The default is the first found of:./pmrep.conf,$HOME/.pmrep.conf,$HOME/pcp/pmrep.conf,and$PCP_SYSCONF_DIR/pmrep/pmrep.conf.Seepmrep.conf(5).
Fetch performance metrics from the specifiedcontainer,either local or remote (see-h).
Exit before reporting any values, but after parsing the configurationand metrics and printing possible headers.
When replaying from an archive, this option requests that the prevailingreal-time delay be applied between samples (see-t)to effect a pause, rather thanthe default behaviour of replaying at full speed.
Daemonize on startup.
Specifyderivedperformance metrics.Ifderivedstarts with a slash (``/'') or with a dot (``.'') it will beinterpreted as a derived metrics configuration file, otherwise it willbe interpreted as comma- or semicolon-separated derived metric expressions.For details seepmLoadDerivedConfig(3)andpmRegisterDerived(3).
Repeat the header everylinesof output.See also-1.
Use theformatstring for formatting the timestamp.The format will be used with Python'sdatetime.strftimemethod which is mostly the same as that described instrftime(3).An emptyformatstring (i.e., "") will remove the timestamps from the output.Defaults to%H:%M:%Swhen using thestdoutoutput target.Defaults to%Y-%m-%d %H:%M:%Swhen using thecsvoutput target.
Specify the output fileoutfile.See-o.
Output the column number and complete metric information,one-per-line, before printing the metric values.
Do not include global metrics in reporting (seepmrep.conf(5)).
Fetch performance metrics frompmcd(1)onhost,rather than from the default localhost.
Do not print any headers.
Report only the listedinstancesfrom current instances (if present, see also-j).By default all current instances are reported,except when writing an archive (see-o)when all instances, present and future, are reported.This is a global option that is used for all metrics unless ametric-specific instance definition is provided as part of ametricspec.By default single-valued ``flat'' metrics without multipleinstances are still reported as usual, use-vto change this.

The list may consist of one or more comma-separated instances.The instance name may be quoted with single (') or double (")quotes for those cases where the instance name contains commasor whitespace.Note that on the command line when specifying more than one instance,all the names must be quoted.

Multiple-ioptions are allowed as an alternative way of specifying more thanone instance of interest.Regular expressions can also be used.

As an example, the following would report the same instances:

$ 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"'


However, this would report only the 1-minute instance:

$ pmrep -i '"1 minute","5 minute"' kernel.all.load,,"1 minute"


But this would report all instances (due to per-metric override):

$ pmrep -i '"1 minute","5 minute"' 'kernel.all.load,,.*'


Ignore incompatible metrics.By default incompatible metrics (that is,their type is unsupported or they cannot be scaled as requested)will causepmrepto terminate with an error message.With this option all incompatible metrics are silently omittedfrom reporting.This may be especially useful when requestingnon-leaf nodes of the PMNS tree for reporting.
Perform instance live filtering.This allows capturing all filtered instances even if processesare restarted at some point (unlike without live filtering).Performing live filtering over a huge amount of instances will addsome internal overhead so a bit of user caution is advised.See also-1 and -n.
Limit results to highest/lowestrankinstances 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.See also-2,-6 and -8.
Write extended CSV output, similar tosadf(1).
When fetching metrics from a local context (see-L),the-Koption may be used to control the DSO PMDAs that should be made accessible.Thespecargument conforms to the syntax described inpmSpecLocalPMDA(3).More than one-Koption may be used.
Specify thedelimiterthat separates each column ofcsvorstdoutoutput.The default forstdoutis two spaces (`` '') and comma (``,'') forcsv.In case of CSV output or stdout output with non-whitespace delimiter,any instances of the delimiter in string values will be replaced bythe underscore (``_'') character.
Use a local context to collect metrics from DSO PMDAs on the local hostwithout PMCD.See also-K.
Perform ranking before live filtering.By default instance live filtering (when requested, see-j)happens before instance ranking (when requested, see-J).With this option the logic is inverted and ranking happens beforelive filtering.
Specify a comma-separated list ofpredicatefilter reference metrics.By default ranking (see-J)happens for each metric individually.With predicates, ranking is done only for thespecified predicate metrics.When reporting, rest of the metrics sharing the sameinstance domain(seePCPIntro(1))as the predicate will include only the highest/lowest rankinginstances of the corresponding predicate.

So for example, using proc.memory.rss (resident memory size of process) as the predicatemetric together with proc.io.total_bytes and mem.util.used as metrics to be reported, only the processes using most/least (as per -J)memory will be included when reporting total bytes written by processes.Since mem.util.used is a single-valued metric (thus not sharing the same instance domain as the process-related metrics), it will be reported as usual.

Useoutputtarget for reporting.The default target isstdout.The available target alternatives are:
Record metrics into a PCP archive which can later be replayed with PCPtools, includingpmrepitself.SeeLOGARCHIVE(5)andPCPIntro(1)for details about PCP archive files.Requires-F.
Print metrics in CSV format (subject to formatting options).
Print metrics to stdout (format subject to formatting options).
When reporting archived metrics, start reporting atoriginwithin the time window (see-Sand-T).Refer toPCPIntro(1)for a complete description of the syntax fororigin.
Print timestamps.By default no timestamps are printed.
Useprecisionfor numeric non-integer output values.If the value is too wide for its column width,precisionis 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 not override possible per-metric specifications.
Unit/scalefor count metrics, possible values includecount x 10^-1,count,count x 10,count x 10^2,and so forth from10^-8to10^7.(These values are currently space-sensitive.)This option will not override possible per-metric specifications. See also pmParseUnitsStr(3).
Like-qbut this option will override per-metric specifications.
Output raw metric values, do not convert cumulative counters to rates.When writing archives, raw values are always used.This option will override possible per-metric specifications.
Like-rbut this option will not override per-metric specifications.
The argumentsamplesdefines the number of samples to be retrieved and reported.Ifsamplesis 0 or-sis not specified,pmrepwill sample and report continuously (in real time mode) or until the endof the set of PCP archives (in archive mode).See also-T.
When reporting archived metrics, the report will be restricted to thoserecords logged at or afterstarttime.Refer toPCPIntro(1)for a complete description of the syntax forstarttime.
The default updateintervalmay be set to something other than the default 1 second.Theintervalargument follows the syntax described inPCPIntro(1),and in the simplest form may be an unsigned integer(the implied units in this case are seconds).See also the-Tand-uoptions.
When reporting archived metrics, the report will be restricted to thoserecords logged before or atendtime.Refer toPCPIntro(1)for a complete description of the syntax forendtime.

When used to define the runtime before pmrep will exit, if no samples is given (see -s) then the number of reported samples depends on interval (see -t). If samplesis given thenintervalwill be adjusted to allow reporting ofsamplesduring runtime.In case all of-T,-s,and-tare given,endtimedetermines the actual timepmrepwill run.

When reporting archived metrics, by default values are reportedaccording to the selected sample interval (-toption), not according to the actual record interval in an archive.To this effect PCP interpolates the values to be reported based on therecords in the archive.With the-uoption uninterpolated reporting is enabled, every recorded value for theselected metrics is reported and the requested sample interval (-t)is ignored.

So for example, if a PCP archive contains recorded values for every 10seconds and the requested sample interval is 1 hour, by defaultpmrepwill use an interpolation scheme to compute the values of the requestedmetrics from the values recorded in the proximity of these requestedmetrics and values for every 1 hour are reported.With-uevery record every 10 seconds are reported as such (the reported valuesare still subject to rate conversion, use-ror-Rto disable).

Omit unit information from headers.
Omit single-valued ``flat'' metrics from reporting, only considerset-valued metrics (i.e., metrics with multiple values) for reporting.See-iand-I.
Display version number and exit.
Set thestdoutoutput columnwidth.Strings will be truncated to this width.The defaultwidthis the shortest that can fit the metric text label, the forced minimum is 3.This option will not override possible per-metric specifications.
Like-wbut this option will override per-metric specifications.
Print extended header.
Swap columns and rows in stdout output, reporting one instance per line, using label as the text label for instance column (set to an empty string "" to enable swapping without a specific text label). This is convenient to allow easily using grep(1)to filter results or to more closely mimic other utilities.See also-i and -6.
Unit/scalefor time metrics, possible values includenanosec,ns,microsec,us,millisec,ms,and so forth up tohour,hr.This option will not override possible per-metric specifications. See also pmParseUnitsStr(3).
Like-ybut this option will override per-metric specifications.
Use the local timezone of the host that is the source of theperformance metrics, as identified by either the-hor the-aoptions.The default is to use the timezone of the local host.
Usetimezonefor the date and time.Timezoneis in the format of the environment variableTZas described inenviron(7).Note that when including a timezone string in output, ISO 8601 -styleUTC offsets are used (so something like -Z EST+5 will become UTC-5).
-?, --help
Display usage message and exit.

EXAMPLES

The following examples use the standard PCP facilities for collectingthe metric values, no external utilities are needed.The referenced colon-startingmetricsetsare part of the system pmrep.conf file.

Display network interface metrics on the local host:

$ pmrep network.interface.total.bytes

Display all outgoing network metrics for thewlan0interface:

$ pmrep -i wlan0 -v network.interface.out

Display timestampedvmstat(8)like information using megabytes instead of kilobytes and also includethe number of inodes used (tab completes available metrics andafter a colon metricsets with bash and zsh):

$ pmrep -p -B MB :vmstat vfs.inodes.count

Display per-device disk reads and writes from the hostserver1using two seconds interval andsadf(1)like CSV output format:

$ pmrep -h server1 -t 2s -o csv -k disk.dev.read disk.dev.write

Display processes using at least 100MB of memory usingdynamic headers:

$ pmrep -b MB --limit-filter 100 --dynamic-header proc.memory.rss

Display the predefined set of metrics from the defaultpmrep.conf(5)containing information about I/O issued by currentfirefox process(es):

$ pmrep -i '.*firefox.*' :proc-io

Display the three most CPU-using processes:

$ pmrep -1gUJ 3 proc.hog.cpu

Displaysar -wandsar -Wlike information at the same time from the PCP archive./20150921.09.13showing values recorded between 3 - 5 PM:

$ pmrep -a ./20150921.09.13 -S @15:00 -T @17:00 :sar-w :sar-W

Record most relevant CPU, memory, and I/O related information aboutevery Java process on the system, present and future, to an archive./aon one minute interval at every full minute in a background process:

$ pmrep --daemonize -A 1m -t 1m -i '.*java.*' -j -o archive -F ./a \

:proc-info :proc-cpu :proc-mem :proc-io

Record all 389 Directory Server, XFS file system, and CPU/memory/diskmetrics every five seconds for five minutes to a PCP archive./a:

$ pmrep -t 5s -T 5m -o archive -F ./a ds389 xfs kernel.all.cpu mem disk

Record process memory and I/O information for those processeswhich are the three most memory-consuming processes:

$ pmrep -o archive -F ./a -J 3 -N proc.memory.rss proc.memory proc.io

FILES

pmrep configuration file (see -c)
$PCP_SYSCONF_DIR/pmrep/pmrep.conf
system provided pmrep configuration file

PCPENVIRONMENT

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

For environment variables affecting PCP tools, see pmGetOptions(3).

SEEALSO

mkaf(1),PCPIntro(1),pcp(1),pcp-atop(1),pcp2elasticsearch(1),pcp2graphite(1),pcp2influxdb(1),pcp2json(1),pcp2spark(1),pcp2xlsx(1),pcp2xml(1),pcp2zabbix(1),pmcd(1),pmchart(1),pmcollectl(1),pmdiff(1),pmdumplog(1),pmdumptext(1),pminfo(1),pmiostat(1),pmlogextract(1),pmlogsummary(1),pmprobe(1),pmstat(1),pmval(1),sadf(1),sar(1),pmGetOptions(3),pmSpecLocalPMDA(3),pmLoadDerivedConfig(3),pmParseUnitsStr(3),pmRegisterDerived(3),strftime(3),LOGARCHIVE(5),pcp.conf(5),pmns(5),pmrep.conf(5),environ(7)andvmstat(8).

PCP Performance Co-Pilot