def do_polling(self):
"""Polls modules for statistics data. Return nothing. First
search multiple instances of same module. Second requests
- each module to invoke 'getstats' with a 'trees' argument.
- Finally updates internal statistics data every time it gets
- from each instance."""
+ each module to invoke 'getstats'. Finally updates internal
+ statistics data every time it gets from each instance."""
# count the number of instances of same module by examing
# 'components' of Boss via ConfigManager
logger.debug(DBG_STATS_MESSAGING, STATS_SEND_STATISTICS_REQUEST,
module_name)
cmd = isc.config.ccsession.create_command(
- "getstats", {'trees': [k for k in data.keys()]})
+ "getstats", None) # no argument
seq = self.cc_session.group_sendmsg(cmd, module_name)
sequences.append((module_name, seq))
cnt = modules.count(module_name)
self._started.set()
self.got_command_name = command
sdata = self.statistics_data
- params = { "owner": "Boss",
- "data": sdata
- }
if command == 'getstats':
- notfound = [ t for t in args[0]['trees'] if t not in sdata ]
- if notfound:
- return isc.config.create_answer(1, notfound)
- return isc.config.create_answer(
- 0, dict([(t,sdata[t]) for t in args[0]['trees'] if t in sdata ]))
+ return isc.config.create_answer(0, self.statistics_data)
elif command == 'show_processes':
# Return dummy pids
return isc.config.create_answer(
'queries.udp': self.queries_udp,
'queries.perzone' : self.queries_per_zone }
if command == 'getstats':
- notfound = [ t for t in args[0]['trees'] if t not in sdata ]
- if notfound:
- return isc.config.create_answer(1, notfound)
- return isc.config.create_answer(
- 0, dict([(t,sdata[t]) for t in args[0]['trees'] if t in sdata ]))
+ return isc.config.create_answer(0, sdata)
return isc.config.create_answer(1, "Unknown Command")
class MyStats(stats.Stats):