[Git][NTPsec/ntpsec][master] 4 commits: Add uSec/mSec autoscale on Peer Jitter.

Gary E. Miller gitlab at mg.gitlab.com
Sun Sep 4 20:46:01 UTC 2016


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


Commits:
ea787668 by Gary E. Miller at 2016-09-04T13:31:56-07:00
Add uSec/mSec autoscale on Peer Jitter.

Flip on the 99% and 1% points, which fails for some perverse
 one-of bad data points.

- - - - -
828e10a4 by Gary E. Miller at 2016-09-04T13:35:29-07:00
remove more crufty gprintf()

gprintf() as used is a nop.

- - - - -
e75ebed7 by Gary E. Miller at 2016-09-04T13:38:47-07:00
More gprintf() removals.

- - - - -
f110a4d1 by Gary E. Miller at 2016-09-04T13:45:02-07:00
Stop doing our own @ escapes, use Python %% instead.

- - - - -


1 changed file:

- ntpstats/ntpviz


Changes:

=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -116,8 +116,8 @@ set rmargin 12
         sitename = self.sitename
         plot_template = NTPViz.Common + """\
 set title "%(sitename)s: Local Clock Time/Frequency Offsets"
-set ytics format "@1.2f μs" nomirror textcolor rgb '#0060ad'
-set y2tics format "@2.3f ppm" nomirror textcolor rgb '#dd181f'
+set ytics format "%%1.2f μs" nomirror textcolor rgb '#0060ad'
+set y2tics format "%%2.3f ppm" nomirror textcolor rgb '#dd181f'
 set key bottom right box
 set style line 1 lc rgb '#0060ad' lt 1 lw 1 pt 7 ps 0   # --- blue
 set style line 2 lc rgb '#dd181f' lt 1 lw 1 pt 5 ps 0   # --- red
@@ -148,7 +148,7 @@ plot \
 
         plot_template = NTPViz.Common + """\
 set title "%(sitename)s: Local Temps"
-set ytics format "@1.1f °C" nomirror textcolor rgb '#0060ad'
+set ytics format "%%1.1f °C" nomirror textcolor rgb '#0060ad'
 set style line 1 lc rgb '#0060ad' lt 1 lw 1 pt 7 ps 0   # --- blue
 plot \\
 """ % locals()
@@ -178,16 +178,16 @@ plot \\
         nn_m_o     = ninetynine - one
         plot_template = NTPViz.Common + """\
 set title "%(sitename)s: Local Clock Frequency Offset"
-set ytics format "@1.3f ppm" nomirror
+set ytics format "%%1.3f ppm" nomirror
 set key bottom right box
 set style line 1 lc rgb '#0060ad' lt 1 lw 1 pt 7 ps 0   # --- blue
 set style line 2 lc rgb '#dd181f' lt 1 lw 1 pt 5 ps 0   # --- red
-set label 1 gprintf("99@@ = %(ninetynine)s ppm",99) at graph 0.01,0.3 left front
-set label 2 gprintf("95@@ = %(ninetyfive)s ppm",95) at graph 0.01,0.25 left front
-set label 3 gprintf(" 5@@ = %(five)s ppm",5) at graph 0.01,0.2 left front
-set label 4 gprintf(" 1@@ = %(one)s ppm",1) at graph 0.01,0.15 left front
-set label 5 gprintf("95@@ - 5@@ = %(nf_m_f)s ppm",90) at graph 0.01,0.1 left front
-set label 6 gprintf("99@@ - 1@@ = %(nn_m_o)s ppm",98) at graph 0.01,0.05 left front
+set label 1 "99%% = %(ninetynine)s ppm" at graph 0.01,0.3 left front
+set label 2 "95%% = %(ninetyfive)s ppm" at graph 0.01,0.25 left front
+set label 3 " 5%% = %(five)s ppm" at graph 0.01,0.2 left front
+set label 4 " 1%% = %(one)s ppm" at graph 0.01,0.15 left front
+set label 5 "95%% - 5%% = %(nf_m_f)s ppm" at graph 0.01,0.1 left front
+set label 6 "99%% - 1%% = %(nn_m_o)s ppm" at graph 0.01,0.05 left front
 plot \
  "-" using 1:3 title "local clock error" with linespoints ls 2, \
  %(ninetynine)s title "99th percentile", \
@@ -286,49 +286,49 @@ plot \
             # only one peer
             percentages = ""
             title += ": "+ peerlist[0]
+            ninetynine = self.percentile(fld, 99, peerdict[ip]) * 1000000
+            one        = self.percentile(fld,  1, peerdict[ip]) * 1000000
+            if 1000 <= ninetynine or -1000 >= one:
+                # go to millisec
+                unit = "ms"
+                multiplier = 1000
+                ninetynine /= 1000
+                one /= 1000
+            ninetynine = round( ninetynine, 3)
+            one        = round( one, 3)
+
             if "offset" == type:
-                ninetynine = self.percentile(4, 99, peerdict[ip]) * 1000000
-                ninetyfive = self.percentile(4, 95, peerdict[ip]) * 1000000
-                fifty      = self.percentile(4, 50, peerdict[ip]) * 1000000
-                five       = self.percentile(4,  5, peerdict[ip]) * 1000000
-                one        = self.percentile(4,  1, peerdict[ip]) * 1000000
-                if 1000 <= ninetynine:
-                    # go to millisec
-                    unit = "ms"
-                    multiplier = 1000
-                    ninetynine /= 1000
-                    ninetyfive /= 1000
-                    fifty      /= 1000
-                    five       /= 1000
-                    one        /= 1000
-
-                ninetynine = round( ninetynine, 3)
+                # fld == 4
+                ninetyfive = self.percentile(4, 95, peerdict[ip]) * multiplier
+                fifty      = self.percentile(4, 50, peerdict[ip]) * multiplier
+                five       = self.percentile(4,  5, peerdict[ip]) * multiplier
+
                 ninetyfive = round( ninetyfive, 3)
                 fifty      = round( fifty, 3)
                 five       = round( five, 3)
-                one        = round( one, 3)
                 nf_m_f     = ninetyfive - five
                 nn_m_o     = ninetynine - one
                 percentages = "\n%(fifty)s title '50th percentile', \\" \
                     % locals()
                 labels = """\
-set label 1 gprintf("99@@ = %(ninetynine)s %(unit)s",99) at graph 0.01,0.95 left front
-set label 2 gprintf("95@@ = %(ninetyfive)s %(unit)s",95) at graph 0.01,0.90 left front
-set label 3 gprintf("50@@ = %(fifty)s %(unit)s",50) at graph 0.01,0.85 left front
-set label 4 gprintf("5@@ = %(five)s %(unit)s",5) at graph 0.01,0.80 left front
-set label 5 gprintf("1@@ = %(one)s %(unit)s",1) at graph 0.01,0.75 left front
-set label 6 gprintf("95@@ - 5@@ = %(nf_m_f)s %(unit)s",90) at graph 0.01,0.70 left front
-set label 7 gprintf("99@@ - 1@@ = %(nn_m_o)s %(unit)s",98) at graph 0.01,0.65 left front
+set label 1 "99%% = %(ninetynine)s %(unit)s" at graph 0.01,0.95 left front
+set label 2 "95%% = %(ninetyfive)s %(unit)s" at graph 0.01,0.90 left front
+set label 3 "50%% = %(fifty)s %(unit)s" at graph 0.01,0.85 left front
+set label 4 "5%% = %(five)s %(unit)s" at graph 0.01,0.80 left front
+set label 5 "1%% = %(one)s %(unit)s" at graph 0.01,0.75 left front
+set label 6 "95%% - 5%% = %(nf_m_f)s %(unit)s" at graph 0.01,0.70 left front
+set label 7 "99%% - 1%% = %(nn_m_o)s %(unit)s" at graph 0.01,0.65 left front
 """ % locals()
 
         else:
+            # many peers
             title += "s"
             percentages = ""
 
         plot_template = NTPViz.Common + """\
 set title "%(sitename)s: %(title)s"
 set ylabel ""
-set ytics format "@1.0f %(unit)s" nomirror
+set ytics format "%%1.0f %(unit)s" nomirror
 set key top right box
 %(labels)s
 plot \\%(percentages)s
@@ -356,7 +356,7 @@ plot \\%(percentages)s
         plot_template = NTPViz.Common + """\
 set title "%(sitename)s: offset of %(host)s"
 set ylabel ""
-set ytics format "@1.0f μs" nomirror
+set ytics format "%%1.0f μs" nomirror
 set key top right box
 plot \
 '-' using 1:($4*1000000) title 'offset' with line, \
@@ -410,7 +410,7 @@ set terminal png size 900,600
 set grid
 set xtic rotate by -45 scale 0
 set title "%(sitename)s: Local Clock Time Offset - Histogram"
-set xtics format "@1.1f μs" nomirror
+set xtics format "%%1.1f μs" nomirror
 set style arrow 1 nohead
 set arrow from %(m1sigma)s,0 to %(m1sigma)s,graph 0.90 as 1
 set style arrow 2 nohead
@@ -453,7 +453,7 @@ def local_offset_multiplot(statlist):
     "Plot comparative local offsets for a list of NTPViz objects."
     plot = NTPViz.Common + '''\
 set title "Local Clock Offsets"
-set ytics format "@1.2f μs" nomirror textcolor rgb "#0060ad"
+set ytics format "%%1.2f μs" nomirror textcolor rgb "#0060ad"
 set key bottom right box
 plot \\
 '''



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/23b9f3f5591d7512b1829ffc0135d4c2f41dca06...f110a4d1d24ba4c829d7f33be4881220e1e2680f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160904/2c282c25/attachment.html>


More information about the vc mailing list