[svn] commit: r2408 - in /experiments/fujiwara-stats: configure.ac src/bin/stats/statsd_1session.py.in

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Jul 2 10:01:57 UTC 2010


Author: fujiwara
Date: Fri Jul  2 10:01:57 2010
New Revision: 2408

Log:
statsd_1session.py.in is a test version which uses 
single msgq session and check_command_without_recvmsg method

Modified:
    experiments/fujiwara-stats/configure.ac
    experiments/fujiwara-stats/src/bin/stats/statsd_1session.py.in

Modified: experiments/fujiwara-stats/configure.ac
==============================================================================
--- experiments/fujiwara-stats/configure.ac (original)
+++ experiments/fujiwara-stats/configure.ac Fri Jul  2 10:01:57 2010
@@ -448,6 +448,7 @@
            src/bin/auth/auth.spec.pre
            src/bin/auth/spec_config.h.pre
            src/bin/stats/statsd.py
+           src/bin/stats/statsd_1session.py
            src/lib/config/tests/data_def_unittests_config.h
            src/lib/python/isc/config/tests/config_test
            src/lib/python/isc/cc/tests/cc_test

Modified: experiments/fujiwara-stats/src/bin/stats/statsd_1session.py.in
==============================================================================
--- experiments/fujiwara-stats/src/bin/stats/statsd_1session.py.in (original)
+++ experiments/fujiwara-stats/src/bin/stats/statsd_1session.py.in Fri Jul  2 10:01:57 2010
@@ -128,25 +128,25 @@
     def main(self):
         if self.debug:
             print  ("statsd: Statistics.main()")
-        self.ccs = isc.config.ModuleCCSession(SPECFILE_LOCATION, self.config_handler, self.command_handler)
+        self.session = Session()
+        self.session.group_subscribe("statistics", "*")
+        self.ccs = isc.config.ModuleCCSession(SPECFILE_LOCATION, self.config_handler, self.command_handler, self.session)
         self.ccs.start()
-        print ("config lname=",self.ccs._session.lname)
         if self.debug:
             print ("[statsd] ccsession started")
-        self.session = Session()
-        print ("another lname=",self.session.lname)
-        self.session.group_subscribe("statistics", "*")
+        print ("config lname=",self.ccs._session.lname)
         wait = None
         while not self.shutdown:
             if self.debug:
                 print ("loop")
-            r,w,e = select.select([self.session._socket, self.ccs._session._socket],[],[], wait)
+            r,w,e = select.select([self.session._socket],[],[], wait)
             for sock in r:
                 if sock == self.session._socket:
                     data,envelope = self.session.group_recvmsg(True)
-                    self.stats_update(data,envelope)
-                elif sock == self.ccs._session._socket:
-                    self.ccs.check_command(True)
+                    if envelope.group == "statistics":
+                        self.stats_update(data,envelope)
+                    else:
+                        self.ccs.check_command_without_recvmsg(data, envelope)
 
         exit (1)
 




More information about the bind10-changes mailing list