Yo Ian!

> Subject: [Git][NTPsec/ntpsec][master] Added "tai" variable to units
> display, fixed lurking bug in ntpmon.
> 
> Note that tai has not been properly tested as I have never seen it show
> up on my system in the first place. However, it uses the same system as
> all the other variables that display units.

I can not test this as ntpmon now crashes before i can get to the ntpmon
screen with tai on it.

Easy way to crash:

# ntpmon -u
(press 'd' key)
(press [down arrow] key)

Boom:

#  ntpmon -u
Traceback (most recent call last):
  File "/usr/local/bin/ntpmon", line 309, in <module>
    stdscr.addstr(strconvert.encode('UTF-8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 60: 
ordinal not in range(128)




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



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

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

Commits:

  • 88d3fc34
    by Ian Bruene at 2017-04-12T00:23:30+00:00
    Added "tai" variable to units display, fixed lurking bug in ntpmon.
    
    Note that tai has not been properly tested as I have never seen it show up
    on my system in the first place. However, it uses the same system as all
    the other variables that display units.
    

3 changed files:

Changes:

  • devel/units.txt
    ... ... @@ -63,6 +63,7 @@ kppsjitter | seconds | milliseconds
    63 63
     fuzz                  | seconds   | milliseconds
    
    64 64
     clk_wander_threshold  | seconds   | microseconds
    
    65 65
     tick                  | seconds   | milliseconds
    
    66
    +tai                   | seconds   | seconds (* presumed)
    
    66 67
     
    
    67 68
     
    
    68 69
     Peer Variables
    
    ... ... @@ -85,4 +86,4 @@ Clock Variables
    85 86
     Name       | internal | mode 6
    
    86 87
     ====================================
    
    87 88
     fudgetime1 | seconds  | milliseconds
    
    88
    -fudgetime2 | seconds  | milliseconds
    \ No newline at end of file
    89
    +fudgetime2 | seconds  | milliseconds

  • ntpclients/ntpmon
    ... ... @@ -105,8 +105,15 @@ def peer_detail(variables, showunits=False):
    105 105
             for name in ntp.util.PPM_VARS:
    
    106 106
                 if name in vcopy:
    
    107 107
                     vcopy[name] = ntp.util.unitformatter(vcopy[name],
    
    108
    -                                                     ntp.util.UNIT_PPM,
    
    109 108
                                                          ntp.util.UNITS_PPX,
    
    109
    +                                                     ntp.util.UNIT_PPM,
    
    110
    +                                                     strip=True,
    
    111
    +                                                     width=None)
    
    112
    +        for name in ntp.util.S_VARS:
    
    113
    +            if name in vcopy:
    
    114
    +                vcopy[name] = ntp.util.unitformatter(vcopy[name],
    
    115
    +                                                     ntp.util.UNITS_SEC,
    
    116
    +                                                     ntp.util.UNIT_S,
    
    110 117
                                                          strip=True,
    
    111 118
                                                          width=None)
    
    112 119
             vcopy['filtdelay'] = ntp.util.filtcooker(vcopy['filtdelay'])
    

  • pylib/util.py
    ... ... @@ -46,6 +46,7 @@ UNITS_PPX = ["ppt", "ppb", "ppm", "ppk"]
    46 46
     
    
    47 47
     
    
    48 48
     # Variables that have units
    
    49
    +S_VARS = ("tai",)
    
    49 50
     MS_VARS = ("rootdelay", "rootdisp", "offset", "sys_jitter", "clk_jitter",
    
    50 51
                "leapsmearoffset", "authdelay", "koffset", "kmaxerr", "kesterr",
    
    51 52
                "kprecis", "kppsjitter", "fuzz", "clk_wander_threshold", "tick",
    
    ... ... @@ -657,6 +658,12 @@ def cook(variables, showunits=False):
    657 658
                                           True, width=None)
    
    658 659
                 else:
    
    659 660
                     item += repr(value)
    
    661
    +        elif name in S_VARS:
    
    662
    +            if showunits:
    
    663
    +                item += unitformatter(value, UNITS_SEC, UNIT_S, UNIT_NS,
    
    664
    +                                      True, width=None)
    
    665
    +            else:
    
    666
    +                item += repr(value)
    
    660 667
             elif name in PPM_VARS:
    
    661 668
                 if showunits:
    
    662 669
                     item += unitformatter(value, UNITS_PPX, UNIT_PPM,
    

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

    Attachment: pgpKryYr0x3hP.pgp
    Description: OpenPGP digital signature

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

    Reply via email to