[Git][NTPsec/ntpsec][master] ntpviz: Autorange a bit differently in clip mode.

Gary E. Miller gitlab at mg.gitlab.com
Thu Oct 13 02:07:23 UTC 2016


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
a03f16da by Gary E. Miller at 2016-10-12T19:03:39-07:00
ntpviz: Autorange a bit differently in clip mode.

Normally, if most of the data is around 1 few micro sec, but max
data is ten seconds, the autorange unit is set to one second.

In clip mode this can truncate almost all the data.  So in clip mode
autorange to the 1% and 99% points.  Now 5 micro sec will show as
5.000 microsec, not 0.000 sec.

- - - - -


1 changed file:

- ntpstats/ntpviz


Changes:

=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -126,10 +126,16 @@ Mean, Units
         self.percs = self.percentiles( (100, 99, 95, 50, 5, 1, 0), values)
 
         # find the target for autoranging
-        # keep 99% and 5% under 999 in selected units
-        # but do not let 100% and 1% go over 5000 in selected units
-        target = max(self.percs[99], -self.percs[1], self.percs[100]/5,
-                     -self.percs[0]/5)
+        if args.clip:
+            # keep 99% and 1% under 999 in selected units
+            # clip to 1% and 99%
+            target = max(self.percs[99], -self.percs[1])
+        else:
+            # keep 99% and 1% under 999 in selected units
+            # but do not let 100% and 1% go over 5000 in selected units
+            target = max(self.percs[99], -self.percs[1], self.percs[100]/5,
+                         -self.percs[0]/5)
+
         if 1 <= target:
             self.multiplier = 1
             if freq:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/a03f16da052575056f83ee39b1f909248d5a5884
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161013/d01af31d/attachment.html>


More information about the vc mailing list