[Git][NTPsec/ntpsec][master] In ntpmon, retain fast samping during init phase

Eric S. Raymond gitlab at mg.gitlab.com
Mon Dec 26 10:59:27 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
44889427 by Eric S. Raymond at 2016-12-26T05:59:10-05:00
In ntpmon, retain fast samping during init phase

Makes it easy to see peers mobilizing in near real time.

- - - - -


1 changed file:

- ntpclients/ntpmon


Changes:

=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -176,6 +176,7 @@ if __name__ == '__main__':
                     if showpeers and len(peers) == 0:
                         raise Fatal("no peers reported")
                     try:
+                        initphase = False
                         for (i, peer) in enumerate(peers):
                             if not showall and \
                                     not (ntp.control.CTL_PEER_STATVAL(peer.status)
@@ -199,19 +200,23 @@ if __name__ == '__main__':
                             stdscr.addstr(peer_report.summary(session.rstatus,
                                                     variables, peer.associd),
                                           hilite)
+                            if 'INIT' in variables['refid']:
+                                initphase = True
 
                         # Now the MRU report
                         limit = stdscr.getmaxyx()[0] - len(peers)
                         span = session.mrulist(variables={'recent':limit})
                         mru_report.now = time.time()
 
-                        # Nyquist-interval sampling - half the
-                        # smallest poll interval seen in the last
-                        # cycle, rounded up to 1 second.                        
-                        nyquist = int(min(peer_report.intervals()) / 2)
-                        nyquist = 1 if nyquist == 0 else nyquist
-                        if session.debug:
-                            session.logfp.write("nyquist is %d\n" % nyquist)
+                        # After init phase use Nyquist-interval
+                        # sampling - half the smallest poll interval
+                        # seen in the last cycle, rounded up to 1
+                        # second.
+                        if not initphase:
+                            nyquist = int(min(peer_report.intervals()) / 2)
+                            nyquist = 1 if nyquist == 0 else nyquist
+                            if session.debug:
+                                session.logfp.write("nyquist is %d\n" % nyquist)
                         # The status line
                         sl = statline(peer_report, mru_report, nyquist)
                         stdscr.addstr(sl + "\n", curses.A_REVERSE|curses.A_DIM)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/44889427a8ed6b24e9609021444b3b6e65ceca3e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20161226/ca11aff6/attachment.html>


More information about the vc mailing list