pcp
[Top] [All Lists]

pmrep: rename -R to -W

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: pmrep: rename -R to -W
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Sun, 13 Dec 2015 17:50:48 +0200
Delivered-to: pcp@xxxxxxxxxxx
Organization: Red Hat
Reply-to: myllynen@xxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0
Hi,

related to the earlier raw/rate patches, the patch below renames -R to
-W in case we'd want to support requesting rates also for non-counters
in future (-W is not as good as -R for runtime but OTOH having -r/-R
available for raw/rate is nice).

---
 src/pmrep/TODO         |  6 ++--
 src/pmrep/pmrep.1      | 74 +++++++++++++++++++++++++-------------------------
 src/pmrep/pmrep.conf.5 |  2 +-
 src/pmrep/pmrep.py     |  6 ++--
 4 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/src/pmrep/TODO b/src/pmrep/TODO
index c5bfa4c..e25d255 100644
--- a/src/pmrep/TODO
+++ b/src/pmrep/TODO
@@ -31,10 +31,10 @@
 -----
 
 In use / reserved cmd line options:
-AaBbcCdDeEfFGhHKLloOpPqQrRsStTuUVwxyYzZ
+AaBbcCdDeEfFGhHKLloOpPqQrsStTuUVWwxyYzZ
 
 Tentatively planned:
-IigkMm
+IigkMmR
 
 Available:
-JjNnXvW
+JjNnXv
diff --git a/src/pmrep/pmrep.1 b/src/pmrep/pmrep.1
index eb98d94..653561b 100644
--- a/src/pmrep/pmrep.1
+++ b/src/pmrep/pmrep.1
@@ -35,12 +35,12 @@
 [\f3\-O\f1 \f2origin\f1]
 [\f3\-P\f1 \f2precision\f1]
 [\f3\-q\f1 \f2count-scale\f1]
-[\f3\-R\f1 \f2runtime\f1]
 [\f3\-s\f1 \f2samples\f1]
 [\f3\-S\f1 \f2starttime\f1]
 [\f3\-t\f1 \f2interval\f1]
 [\f3\-T\f1 \f2endtime\f1]
 [\f3\-w\f1 \f2width\f1]
+[\f3\-W\f1 \f2runtime\f1]
 [\f3\-y\f1 \f2time-scale\f1]
 [\f3\-Z\f1 \f2timezone\f1]
 \f2metricspec [...]\f1
@@ -437,39 +437,6 @@ See also
 Output raw metric values, do not convert cumulative counters to rates.
 This option \fIwill\fR override possible per-metric specifications.
 .TP
-.B \-R
-The argument
-.I runtime
-defines the time
-.B pmrep
-will run before exiting.
-If no
-.I samples
-is given (see
-.BR \-s )
-then the number of reported samples depends on
-.I interval
-(see
-.BR \-t ).
-If
-.I samples
-is given then
-.I interval
-will be adjusted to allow reporting of
-.I samples
-during
-.IR runtime .
-In case all of
-.BR \-R ,
-.BR \-s ,
-and
-.B \-t
-are given,
-.I runtime
-determines the actual time
-.B pmrep
-will run.
-.TP
 .B \-s
 The argument
 .I samples
@@ -483,7 +450,7 @@ is not specified,
 will sample and report continuously (in real time mode) or until the end
 of the PCP archive (in archive mode).
 See also
-.BR \-R .
+.BR \-W .
 .TP
 .B \-S
 When reporting archived metrics, the report will be restricted to those
@@ -505,7 +472,7 @@ argument follows the syntax described in
 and in the simplest form may be an unsigned integer (the implied units
 in this case are seconds).
 See also the
-.B \-R
+.B \-W
 option.
 .TP
 .B \-T
@@ -563,6 +530,39 @@ This option will
 .I not
 override possible per-metric specifications.
 .TP
+.B \-W
+The argument
+.I runtime
+defines the time
+.B pmrep
+will run before exiting.
+If no
+.I samples
+is given (see
+.BR \-s )
+then the number of reported samples depends on
+.I interval
+(see
+.BR \-t ).
+If
+.I samples
+is given then
+.I interval
+will be adjusted to allow reporting of
+.I samples
+during
+.IR runtime .
+In case all of
+.BR \-W ,
+.BR \-s ,
+and
+.B \-t
+are given,
+.I runtime
+determines the actual time
+.B pmrep
+will run.
+.TP
 .B \-x
 Print extended header.
 .TP
@@ -665,7 +665,7 @@ archive
 .RS +1
 .ft CW
 .nf
-$ pmrep -o archive -F ./a -t 5s -R 5m ds389 xfs kernel.all.cpu disk mem
+$ pmrep -o archive -F ./a -t 5s -W 5m ds389 xfs kernel.all.cpu disk mem
 .fi
 .ft P
 .RE
diff --git a/src/pmrep/pmrep.conf.5 b/src/pmrep/pmrep.conf.5
index ce2a20f..4842c1b 100644
--- a/src/pmrep/pmrep.conf.5
+++ b/src/pmrep/pmrep.conf.5
@@ -174,7 +174,7 @@ runtime (string)
 Indicates the time
 .B pmrep
 will run before exiting. Corresponding command line parameter is
-\fB-R\fR. Follows the time syntax described in
+\fB-W\fR. Follows the time syntax described in
 .BR PCPIntro (1).
 Undefined by default (thus runtime will be determined by the number of
 samples and interval).
diff --git a/src/pmrep/pmrep.py b/src/pmrep/pmrep.py
index c10f405..db90ea9 100644
--- a/src/pmrep/pmrep.py
+++ b/src/pmrep/pmrep.py
@@ -305,7 +305,7 @@ class PMReporter(object):
         opts = pmapi.pmOptions()
         opts.pmSetOptionCallback(self.option)
         opts.pmSetOverrideCallback(self.option_override)
-        
opts.pmSetShortOptions("a:h:LK:c:Co:F:e:D:V?HUGpA:S:T:O:s:t:R:Z:zdrw:P:l:xE:f:uq:b:y:")
+        
opts.pmSetShortOptions("a:h:LK:c:Co:F:e:D:V?HUGpA:S:T:O:s:t:W:Z:zdrw:P:l:xE:f:uq:b:y:")
         opts.pmSetShortUsage("[option...] metricspec [...]")
 
         opts.pmSetLongOptionHeader("General options")
@@ -334,7 +334,7 @@ class PMReporter(object):
         opts.pmSetLongOptionOrigin()       # -O/--origin
         opts.pmSetLongOptionSamples()      # -s/--samples
         opts.pmSetLongOptionInterval()     # -t/--interval
-        opts.pmSetLongOption("runtime", 1, "R", "N", "runtime duration 
(overrides -t or -s)")
+        opts.pmSetLongOption("runtime", 1, "W", "N", "runtime duration 
(overrides -t or -s)")
         opts.pmSetLongOptionTimeZone()     # -Z/--timezone
         opts.pmSetLongOptionHostZone()     # -z/--hostzone
         opts.pmSetLongOption("delay", 0, "d", "", "delay, pause between 
updates for archive replay")
@@ -391,7 +391,7 @@ class PMReporter(object):
             self.globals = 0
         elif opt == 'p':
             self.timestamp = 1
-        elif opt == 'R':
+        elif opt == 'W':
             self.runtime = optarg
         elif opt == 'd':
             self.delay = 1

Thanks,

-- 
Marko Myllynen

<Prev in Thread] Current Thread [Next in Thread>