diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2005-11-28 21:39:04 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2005-11-28 21:39:04 +0000 |
commit | 8b2101c4bb816e53675c6fe8f2a844f63027e223 (patch) | |
tree | 9c4c9e8de9010c9b379abe309d9e588ec30f11ec /src/lib | |
parent | 170ef0a67ae5798d3451160d90a21c0bc526f30f (diff) | |
download | bcfg2-8b2101c4bb816e53675c6fe8f2a844f63027e223.tar.gz bcfg2-8b2101c4bb816e53675c6fe8f2a844f63027e223.tar.bz2 bcfg2-8b2101c4bb816e53675c6fe8f2a844f63027e223.zip |
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
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Core.py | 12 |
1 files changed, 11 insertions, 1 deletions
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 |