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

Eric S. Raymond gitlab at mg.gitlab.com
Tue Feb 21 16:08:53 UTC 2017


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


Commits:
253de053 by Eric S. Raymond at 2017-02-21T11:04:54-05:00
Address GitLab issue #247: Extra precision for avgint field...

This tracks a post-fork change in Classic.

- - - - -


1 changed file:

- pylib/util.py


Changes:

=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -583,12 +583,6 @@ 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:
@@ -599,8 +593,8 @@ class MRUSummary:
         try:
             if self.showhostnames:
                 dns = canonicalize_dns(dns)
-            stats += " %4hx %c %d %d %6d %5s %s" % \
-                     (entry.rs, rscode,
+            stats += " %6d %4hx %c %d %d %6d %5s %s" % \
+                     (avgint, 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/253de053b3e5b21a600db620f56f87f73c37d786
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170221/a5015093/attachment.html>


More information about the vc mailing list