[svn] commit: r2888 - /branches/trac191-rebased/src/bin/bind10/bind10.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Sep 9 08:47:15 UTC 2010


Author: naokikambe
Date: Thu Sep  9 08:47:15 2010
New Revision: 2888

Log:
add lines of sending "bind10.boot_time" to b10-stats

Modified:
    branches/trac191-rebased/src/bin/bind10/bind10.py.in

Modified: branches/trac191-rebased/src/bin/bind10/bind10.py.in
==============================================================================
--- branches/trac191-rebased/src/bin/bind10/bind10.py.in (original)
+++ branches/trac191-rebased/src/bin/bind10/bind10.py.in Thu Sep  9 08:47:15 2010
@@ -66,6 +66,9 @@
 
 # This is the version that gets displayed to the user.
 __version__ = "v20100531"
+
+# This is for bind10.boottime of stats module
+_BASETIME = time.gmtime()
 
 class RestartSchedule:
     """
@@ -730,6 +733,20 @@
         sys.exit(1)
     sys.stdout.write("[bind10] BIND 10 started\n")
 
+    # send "bind10.boot_time" to b10-stats
+    time.sleep(1) # wait a second
+    if options.verbose:
+        sys.stdout.write("[bind10] send \"bind10.boot_time\" to b10-stats\n")
+    cmd = { "command": [
+             'set',
+             { "stats_data": {
+                 'bind10.boot_time': time.strftime('%Y-%m-%dT%H:%M:%SZ', _BASETIME)
+               }
+             }
+            ]
+          }
+    boss_of_bind.cc_session.group_sendmsg(cmd, 'Stats')
+
     # In our main loop, we check for dead processes or messages 
     # on the c-channel.
     wakeup_fd = wakeup_pipe[0]




More information about the bind10-changes mailing list