Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
NTPsec
ntpsec
Commits
714fcadd
Commit
714fcadd
authored
Oct 09, 2016
by
Gary E. Miller
💬
Browse files
ntpviz: save each set of perccentiles, for later output.
parent
e04db9b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
ntpstats/ntpviz
View file @
714fcadd
...
...
@@ -68,6 +68,7 @@ def pstdev(data, mu=None):
#
class
for
calced
values
class
VizStats
(
NTPStats
)
:
percs =
{}
#
dictionary
of
percentages
title =
''
#
title
unit =
's'
#
display
units:
s
,
ppm
,
etc.
multiplier =
1
pmax =
0
#
100%,
can
'
t
use
max
,
reserved
word
...
...
@@ -133,6 +134,7 @@ class VizStats(NTPStats):
self.percs.update
({
k:
v
*
self.multiplier
for
k
,
v
in
list
(
self.percs.items
())})
self.title =
title
self.pmax =
self.percs[100]
self.ninetynine =
self.percs[99]
self.ninetyfive =
self.percs[95]
...
...
@@ -1174,7 +1176,7 @@ Report generated: %(start_time_str)s UTC <br>
<dd>
The difference between the ntpd calculated frequency and the local
system clock frequency (usually in parts per million, ppm)
</dd>
<dt>
jitter:
</dt>
<dt>
jitter
, dispersion
:
</dt>
<dd>
The short term change in a value
</dd>
<dt>
ms, millisecond:
</dt>
...
...
@@ -1296,9 +1298,11 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
if len( plot ):
imagepairs.append(("peer-jitter-" + key, plot))
percs = []
for (imagename, image) in imagepairs:
if not image:
continue
percs.append( image['percs'] )
index_buffer += "
<div>
\n
<h2>
%s:
</h2>
\n" % image['title']
div_name = imagename.replace('-', ' ')
index_buffer += imagewrapper % \
...
...
@@ -1315,6 +1319,12 @@ ntpviz</a>, part of the <a href="https://www.ntpsec.org/">NTPsec project</a>
gnuplot(image['plot'], os.path.join(args.outdir, imagename + ".png"))
index_buffer += "
</div>
\n"
# dump percs
if false:
index_buffer += "
<div>
\n"
index_buffer += str( percs )
index_buffer += "
</div>
\n"
# if footer file, add it to index.html
footer = os.path.join(args.outdir, "footer")
if os.path.isfile(footer):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment