From 8b2101c4bb816e53675c6fe8f2a844f63027e223 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Mon, 28 Nov 2005 21:39:04 +0000 Subject: add timing info to fam/gamin (Logical change 1.368) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1545 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Core.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py index 588ae7670..4350e580a 100644 --- a/src/lib/Server/Core.py +++ b/src/lib/Server/Core.py @@ -54,8 +54,13 @@ class FamFam(object): def Service(self): '''Handle all fam work''' + count = 0 + t1 = time() while self.fm.pending(): + count += 1 self.HandleEvent() + t2 = time() + syslog(LOG_INFO, "Processed %s fam events in %s seconds" % (count, (t2 - t1))) class GaminEvent(object): '''This class provides an event analogous to python-fam events based on gamin sources''' @@ -112,9 +117,14 @@ class GaminFam(object): def Service(self): '''Handle any pending Gamin work''' + count = 0 + t1 = time() while self.mon.event_pending(): + count += 1 self.mon.handle_one_event() - + t2 = time() + syslog(LOG_INFO, "Processed %s gamin events in %s seconds" % (count, (t2 - t1))) + try: from gamin import WatchMonitor, GAMCreated, GAMExists, GAMEndExist, GAMChanged, GAMDeleted monitor = GaminFam -- cgit v1.2.3-1-g7c22