[Git][NTPsec/ntpsec][master] Added "tai" variable to units display, fixed lurking bug in ntpmon.
Gary E. Miller
gitlab at mg.gitlab.com
Wed Apr 12 00:26:38 UTC 2017
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:
- devel/units.txt
- ntpclients/ntpmon
- pylib/util.py
Changes:
=====================================
devel/units.txt
=====================================
--- a/devel/units.txt
+++ b/devel/units.txt
@@ -63,6 +63,7 @@ kppsjitter | seconds | milliseconds
fuzz | seconds | milliseconds
clk_wander_threshold | seconds | microseconds
tick | seconds | milliseconds
+tai | seconds | seconds (* presumed)
Peer Variables
@@ -85,4 +86,4 @@ Clock Variables
Name | internal | mode 6
====================================
fudgetime1 | seconds | milliseconds
-fudgetime2 | seconds | milliseconds
\ No newline at end of file
+fudgetime2 | seconds | milliseconds
=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -105,8 +105,15 @@ def peer_detail(variables, showunits=False):
for name in ntp.util.PPM_VARS:
if name in vcopy:
vcopy[name] = ntp.util.unitformatter(vcopy[name],
- ntp.util.UNIT_PPM,
ntp.util.UNITS_PPX,
+ ntp.util.UNIT_PPM,
+ strip=True,
+ width=None)
+ for name in ntp.util.S_VARS:
+ if name in vcopy:
+ vcopy[name] = ntp.util.unitformatter(vcopy[name],
+ ntp.util.UNITS_SEC,
+ ntp.util.UNIT_S,
strip=True,
width=None)
vcopy['filtdelay'] = ntp.util.filtcooker(vcopy['filtdelay'])
=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -46,6 +46,7 @@ UNITS_PPX = ["ppt", "ppb", "ppm", "ppk"]
# Variables that have units
+S_VARS = ("tai",)
MS_VARS = ("rootdelay", "rootdisp", "offset", "sys_jitter", "clk_jitter",
"leapsmearoffset", "authdelay", "koffset", "kmaxerr", "kesterr",
"kprecis", "kppsjitter", "fuzz", "clk_wander_threshold", "tick",
@@ -657,6 +658,12 @@ def cook(variables, showunits=False):
True, width=None)
else:
item += repr(value)
+ elif name in S_VARS:
+ if showunits:
+ item += unitformatter(value, UNITS_SEC, UNIT_S, UNIT_NS,
+ True, width=None)
+ else:
+ item += repr(value)
elif name in PPM_VARS:
if showunits:
item += unitformatter(value, UNITS_PPX, UNIT_PPM,
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/88d3fc348938f8282939013c317e5cd1e431e495
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170412/ceefda54/attachment.html>
More information about the vc
mailing list