summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/DBStats.py
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2010-06-04 19:20:16 +0000
committerSol Jerome <solj@ices.utexas.edu>2010-06-07 08:42:52 -0500
commit8c4089d7e33a3eae0a53613b1fe491d7808a9ba3 (patch)
tree61721bdee8ca731a0f7ec0f1fd5e3fa1e6634d54 /src/lib/Server/Plugins/DBStats.py
parentb359ebe3f6d70e2d3beceb6210c2681092637c81 (diff)
downloadbcfg2-8c4089d7e33a3eae0a53613b1fe491d7808a9ba3.tar.gz
bcfg2-8c4089d7e33a3eae0a53613b1fe491d7808a9ba3.tar.bz2
bcfg2-8c4089d7e33a3eae0a53613b1fe491d7808a9ba3.zip
Added ThreadedStatistics plugin class. Migrated DBStats to use ThreadedStatistics.
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5889 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/DBStats.py')
-rw-r--r--src/lib/Server/Plugins/DBStats.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/Server/Plugins/DBStats.py b/src/lib/Server/Plugins/DBStats.py
index 49048fad9..1b8052c2d 100644
--- a/src/lib/Server/Plugins/DBStats.py
+++ b/src/lib/Server/Plugins/DBStats.py
@@ -13,14 +13,14 @@ from Bcfg2.Server.Reports.updatefix import update_database
logger = logging.getLogger('Bcfg2.Plugins.DBStats')
class DBStats(Bcfg2.Server.Plugin.Plugin,
- Bcfg2.Server.Plugin.Statistics,
+ Bcfg2.Server.Plugin.ThreadedStatistics,
Bcfg2.Server.Plugin.PullSource):
name = 'DBStats'
__version__ = '$Id$'
def __init__(self, core, datastore):
Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
- Bcfg2.Server.Plugin.Statistics.__init__(self)
+ Bcfg2.Server.Plugin.ThreadedStatistics.__init__(self, core, datastore)
Bcfg2.Server.Plugin.PullSource.__init__(self)
self.cpath = "%s/Metadata/clients.xml" % datastore
self.core = core
@@ -31,13 +31,13 @@ class DBStats(Bcfg2.Server.Plugin.Plugin,
logger.debug(str(inst))
logger.debug(str(type(inst)))
- def process_statistics(self, mdata, xdata):
- newstats = xdata.find("Statistics")
+ def handle_statistic(self, metadata, data):
+ newstats = data.find("Statistics")
newstats.set('time', time.asctime(time.localtime()))
# ick
- xdata = lxml.etree.tostring(newstats)
- ndx = lxml.etree.XML(xdata)
- e = lxml.etree.Element('Node', name=mdata.hostname)
+ data = lxml.etree.tostring(newstats)
+ ndx = lxml.etree.XML(data)
+ e = lxml.etree.Element('Node', name=metadata.hostname)
e.append(ndx)
container = lxml.etree.Element("ConfigStatistics")
container.append(e)