Yo Eric!

I object to this.  We need better float formatting, not worse.
Let NTPClassic keep their bugs to themselves.

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

=====================================
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:


RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        g...@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
Title: GitLab

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:

Changes:

  • pylib/util.py
    ... ... @@ -583,12 +583,6 @@ class MRUSummary:
    583 583
             else:
    
    584 584
                 favgint = active / (entry.ct-1)
    
    585 585
             avgint = int(favgint + 0.5)
    
    586
    -        if 5.0 < favgint or 1 == entry.ct:
    
    587
    -            stats += " %6d" % avgint
    
    588
    -        elif 1.0 <= favgint:
    
    589
    -            stats += " %6.2f" % favgint
    
    590
    -        else:
    
    591
    -            stats += " %6.3f" % favgint
    
    592 586
             if entry.rs & ntp.magic.RES_KOD:
    
    593 587
                 rscode = 'K'
    
    594 588
             elif entry.rs & ntp.magic.RES_LIMITED:
    
    ... ... @@ -599,8 +593,8 @@ class MRUSummary:
    599 593
             try:
    
    600 594
                 if self.showhostnames:
    
    601 595
                     dns = canonicalize_dns(dns)
    
    602
    -            stats += " %4hx %c %d %d %6d %5s %s" % \
    
    603
    -                     (entry.rs, rscode,
    
    596
    +            stats += " %6d %4hx %c %d %d %6d %5s %s" % \
    
    597
    +                     (avgint, entry.rs, rscode,
    
    604 598
                           ntp.magic.PKT_MODE(entry.mv),
    
    605 599
                           ntp.magic.PKT_VERSION(entry.mv),
    
    606 600
                           entry.ct, port[1:], dns)
    

  • _______________________________________________
    vc mailing list
    v...@ntpsec.org
    http://lists.ntpsec.org/mailman/listinfo/vc
    

    Attachment: pgp7qqto_yvPm.pgp
    Description: OpenPGP digital signature

    _______________________________________________
    devel mailing list
    devel@ntpsec.org
    http://lists.ntpsec.org/mailman/listinfo/devel

    Reply via email to