pcp
[Top] [All Lists]

pmrep: tweak unit string

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: pmrep: tweak unit string
From: Marko Myllynen <myllynen@xxxxxxxxxx>
Date: Mon, 13 Jun 2016 16:50:33 +0300
Delivered-to: pcp@xxxxxxxxxxx
Organization: Red Hat
Reply-to: Marko Myllynen <myllynen@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0
Hi,

I noticed that libpcp and most PCP clients report count per second as
"count / sec" but pmrep(1) uses "count/s" (for non-raw counters).

What do you think about the patch below, could we unify the output? I
perhaps slightly prefer the more compact output but in the end it might
be better to be consistent all across the board. Alternatively, we
could of course make pmrep(1) to always use "/s". (If yes, this would
require regenerating/tweaking for QA test case outputs.)

---
 src/pmrep/pmrep.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pmrep/pmrep.py b/src/pmrep/pmrep.py
index b330ca6..2bdaa82 100755
--- a/src/pmrep/pmrep.py
+++ b/src/pmrep/pmrep.py
@@ -734,7 +734,7 @@ class PMReporter(object):
                     (unitstr, mult) = 
self.context.pmParseUnitsStr(self.metrics[metric][2])
                     label = self.metrics[metric][2]
                     if self.descs[i].sem == PM_SEM_COUNTER:
-                        label += "/s"
+                        label += " / sec"
                         if self.descs[i].contents.units.dimTime == 1:
                             label = "util"
                     self.metrics[metric][2] = (label, unitstr, mult)

Thanks,

-- 
Marko Myllynen

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