From e26543b63e91998b065f38acde8dae4fc9e9239c Mon Sep 17 00:00:00 2001 From: wulm Date: Fri, 29 Apr 2016 02:54:25 -0400 Subject: [PATCH 1/2] Change the blank length of pmiostat's output --- src/pcp/iostat/pcp-iostat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pcp/iostat/pcp-iostat.py b/src/pcp/iostat/pcp-iostat.py index e71de7add..45004da07 100755 --- a/src/pcp/iostat/pcp-iostat.py +++ b/src/pcp/iostat/pcp-iostat.py @@ -151,8 +151,8 @@ def report(self, manager): headfmtquspace=precision+6 if "t" in IostatOptions.xflag: - headfmt = "%-24s %-12s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s" - valfmt = "%-24s %-12s %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f" + headfmt = "%-28s %-12s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s" + valfmt = "%-28s %-12s %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f" else: headfmt = "%-12s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s" valfmt = "%-12s %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f %*.*f" From dbd52f2a57ef429136b1f07b5f373b59f40e02b7 Mon Sep 17 00:00:00 2001 From: wulm Date: Wed, 4 May 2016 22:35:27 -0400 Subject: [PATCH 2/2] fix the output samples issue for need two fetches to report rate converted counter metrics. so the actual output samples will be less than the speicified number when using '-s' and '-T' option. '+1' can fix this issue. --- src/python/pcp/pmcc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/python/pcp/pmcc.py b/src/python/pcp/pmcc.py index 0117b262e..cc2587f37 100644 --- a/src/python/pcp/pmcc.py +++ b/src/python/pcp/pmcc.py @@ -618,11 +618,16 @@ def run(self): try: self.fetch() while True: - self._counter += 1 if samples == 0 or self._counter <= samples: self._printer.report(self) if self._counter == samples: break + + # for need two fetches to report rate converted counter + # metrics. so the actual output samples will be less than + # the speicified number when using '-s' and '-T' option. + # '+1' can fix this issue. + self._counter += 1 timer.sleep() self.fetch() except SystemExit as code: