[Git][NTPsec/ntpsec][master] Revert "Address GitLab issue #247: Extra precision for avgint field..."

Eric S. Raymond gitlab at mg.gitlab.com
Thu Feb 23 17:59:18 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
6e45c35a by Eric S. Raymond at 2017-02-23T12:56:04-05:00
Revert "Address GitLab issue #247: Extra precision for avgint field..."

While this tracked Classic, our expert on administration didn't like it
and considered it a functional regression.

- - - - -


1 changed file:

- pylib/util.py


Changes:

=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -583,6 +583,12 @@ class MRUSummary:
         else:
             favgint = active / (entry.ct-1)
         avgint = int(favgint + 0.5)
+        if 5.0 < favgint or 1 == entry.ct:
+            stats += " %6d" % avgint
+        elif 1.0 <= favgint:
+            stats += " %6.2f" % favgint
+        else:
+            stats += " %6.3f" % favgint
         if entry.rs & ntp.magic.RES_KOD:
             rscode = 'K'
         elif entry.rs & ntp.magic.RES_LIMITED:
@@ -593,8 +599,8 @@ class MRUSummary:
         try:
             if self.showhostnames:
                 dns = canonicalize_dns(dns)
-            stats += " %6d %4hx %c %d %d %6d %5s %s" % \
-                     (avgint, entry.rs, rscode,
+            stats += " %4hx %c %d %d %6d %5s %s" % \
+                     (entry.rs, rscode,
                       ntp.magic.PKT_MODE(entry.mv),
                       ntp.magic.PKT_VERSION(entry.mv),
                       entry.ct, port[1:], dns)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/6e45c35aa8febecd4f74af414144b3988ac0a0e0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170223/7732cc6b/attachment.html>


More information about the vc mailing list