Hi,
On 2016-06-14 03:37, Nathan Scott wrote:
> ----- Original Message -----
>>
>> 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).
>
> Yeah, its pmUnitsStr_r(3) in libpcp producing this form IIRC.
>
>> 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
>
> I tend to prefer the compact output too for pmrep, which has strategies
> for producing short column headings that other tools don't employ - so I
> think its fine as-is. But that's just me...
>
>> 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.)
>
> Up to you - if you do choose a new strategy please send through code and
> test updates together, makes life easier at this end. Thanks!
Ok, let's switch to the compact form, the change is trivial and it
covers all the existing metrics (in fact the millisec case is only
needed for a metric from the sample PMDA). Change to this direction
doesn't require QA updates.
---
src/pmrep/pmrep.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/pmrep/pmrep.py b/src/pmrep/pmrep.py
index b330ca6..d73dda2 100755
--- a/src/pmrep/pmrep.py
+++ b/src/pmrep/pmrep.py
@@ -739,7 +739,8 @@ class PMReporter(object):
label = "util"
self.metrics[metric][2] = (label, unitstr, mult)
else:
- self.metrics[metric][2] = (unitstr, unitstr, 1)
+ label = unitstr.replace(" / sec", "/s").replace(" /
millisec", "/ms")
+ self.metrics[metric][2] = (label, unitstr, 1)
except pmapi.pmErr as error:
sys.stderr.write("%s: %s.\n" % (str(error),
self.metrics[metric][2]))
sys.exit(1)
Thanks,
--
Marko Myllynen
|