[Git][NTPsec/ntpsec][master] 2 commits: remove unused variables

Gary E. Miller gitlab at mg.gitlab.com
Sat Oct 1 03:25:15 UTC 2016


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


Commits:
f9bea8a0 by Gary E. Miller at 2016-09-30T20:24:53-07:00
remove unused variables

- - - - -
ff783e17 by Gary E. Miller at 2016-09-30T20:24:53-07:00
remove some more unused vars.

- - - - -


1 changed file:

- ntpstats/ntpviz


Changes:

=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -81,7 +81,7 @@ class VizStats(NTPStats):
     pstd        = 0     # population standard distribution, one sigma
 
     stats_html  = ''
-    
+
     def __init__( self, values, freq=0 ):
 
         values.sort()
@@ -364,20 +364,12 @@ a local gpsd daemon, and logging the data using gps-log.py.</p>
         stats = VizStats( values, freq=1 )
         unit = stats.unit
         multiplier = stats.multiplier
-        percs = stats.percs
 
         ninetynine  = stats.ninetynine
         ninetyfive  = stats.ninetyfive
-        fifty       = stats.fifty
         five        = stats.five
         one         = stats.one
 
-        nf_m_f      = stats.nf_m_f
-        nn_m_o      = stats.nn_m_o
-
-        mu          = stats.mu
-        pstd        = stats.pstd
-
         plot_template = NTPViz.Common + """\
 set title "%(sitename)s: Local Clock Frequency Offset"
 set ytics format "%%1.1f %(unit)s" nomirror
@@ -400,10 +392,10 @@ from temperature changes (ex: HVAC, the weather, CPU usage causing local
 heating).</p>
 
 <p>Smaller changes are better.  An ideal result would be a horizontal
-line at 0ppm.  Expected values of 99%%-1%% percentiles: 0.4ppm</p>
+line at 0ppm.  Expected values of 99%-1% percentiles: 0.4ppm</p>
 
 <p>The Frequency Offset comes from field 3 of the loopstats log file.</p>
-""" % locals()
+"""
         ret = {'html' : stats.stats_html + exp, 'percs' : stats.percs }
         ret['title'] = "Local Clock Frequency Offset"
         ret['plot'] = plot_template + self.dump("loopstats")
@@ -421,20 +413,12 @@ line at 0ppm.  Expected values of 99%%-1%% percentiles: 0.4ppm</p>
         stats = VizStats( values, freq=freq )
         unit = stats.unit
         multiplier = stats.multiplier
-        percs = stats.percs
 
         ninetynine  = stats.ninetynine
         ninetyfive  = stats.ninetyfive
-        fifty       = stats.fifty
         five        = stats.five
         one         = stats.one
 
-        nf_m_f      = stats.nf_m_f
-        nn_m_o      = stats.nn_m_o
-
-        mu          = stats.mu
-        pstd        = stats.pstd
-
         if freq:
             title = "Local Stability"
             exp = """\
@@ -473,7 +457,7 @@ plot \
  %(one)s title "1st percentile"
 """ % locals()
 
-        ret = {'html' : stats.stats_html + exp, 'percs' : percs, 
+        ret = {'html' : stats.stats_html + exp, 'percs' : stats.percs,
                'title' : title }
         ret['plot'] = plot_template + self.dump("loopstats")
         return ret
@@ -531,7 +515,7 @@ plot \
             stats = VizStats( values )
             unit        = stats.unit
             multiplier  = stats.multiplier
-            percs       = stats.percs
+            persc       = stats.percs
 
             ninetynine  = stats.ninetynine
             ninetyfive  = stats.ninetyfive
@@ -539,12 +523,6 @@ plot \
             five        = stats.five
             one         = stats.one
 
-            nf_m_f      = stats.nf_m_f
-            nn_m_o      = stats.nn_m_o
-
-            mu          = stats.mu
-            pstd        = stats.pstd
-
             percentages = " %(fifty)s title '50th percentile', " \
                            % locals()
 
@@ -681,7 +659,6 @@ plot \
         stats = VizStats( values )
         unit        = stats.unit
         multiplier  = stats.multiplier
-        percs       = stats.percs
 
         ninetynine  = stats.ninetynine
         ninetyfive  = stats.ninetyfive
@@ -689,17 +666,10 @@ plot \
         five        = stats.five
         one         = stats.one
 
-        nf_m_f      = stats.nf_m_f
-        nn_m_o      = stats.nn_m_o
-
-        mu          = stats.mu
-        pstd        = stats.pstd
-
-        percs = self.percentiles( (99, 95, 50, 5, 1), values)
-
+        # fixme, should piggy back on unit
         rnd1 = 7        # round to 100 ns boxes
         boxwidth = 1e-7
-        if 1e-6 > percs[99] and -1e-6 < percs[1]:
+        if 1e-6 > stats.percs[99] and -1e-6 < stats.percs[1]:
             # go to nanosec
             rnd1 = 9        # round to 1 ns boxes
             boxwidth = 1e-9
@@ -711,8 +681,8 @@ plot \
             cnt[ round( float(value), rnd1)] += 1
 
         # plus/minus of one sigma range
-        m1sigma = mu - pstd
-        p1sigma = mu + pstd
+        m1sigma = stats.mu - stats.pstd
+        p1sigma = stats.mu + stats.pstd
 
         plot_template = '''\
 set terminal png size 900,600
@@ -753,7 +723,7 @@ plot \
         exp = """\
 <p>This shows the clock offsets of the local clock as a histogram.</p>
 """ % locals()
-        ret = {'html' : stats.stats_html + exp, 'percs' : percs}
+        ret = {'html' : stats.stats_html + exp, 'percs' : stats.percs}
         ret['title'] = "Local Clock Time Offset Histogram"
         ret['plot'] = plot_template + "".join(histogram_data)
         return ret



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/d1cc3bf2f5720dedbfd099e01e35d5d0a78e6179...ff783e173a5e489b4d8c45f0b1bbf0308e6bb61e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161001/6c1d7033/attachment.html>


More information about the vc mailing list