Refactoring monitoring

This commit is contained in:
Andrey Pohilko 2012-09-13 21:51:58 +04:00
parent e530fb69b0
commit 1a6b3c3f99
19 changed files with 4 additions and 3 deletions

View File

@ -1,9 +1,9 @@
from Monitoring.collector import MonitoringCollector
from Tank.Core import AbstractPlugin from Tank.Core import AbstractPlugin
from Tank.Plugins.DataUploader import DataUploaderPlugin from Tank.Plugins.DataUploader import DataUploaderPlugin
from Tank.Plugins.Phantom import PhantomPlugin from Tank.Plugins.Phantom import PhantomPlugin
import os import os
import tempfile import tempfile
from MonCollector.collector import MonitoringCollector
# TODO: wait for first monitoring data # TODO: wait for first monitoring data
class MonitoringPlugin(AbstractPlugin): class MonitoringPlugin(AbstractPlugin):

View File

@ -265,7 +265,8 @@ class PhantomPlugin(AbstractPlugin):
self.log.debug("stpd-hash source: %s", hashed_str) self.log.debug("stpd-hash source: %s", hashed_str)
hasher.update(hashed_str) hasher.update(hashed_str)
os.makedirs(self.cache_dir) if not os.path.exists(self.cache_dir):
os.makedirs(self.cache_dir)
stpd = self.cache_dir + '/' + os.path.basename(self.ammo_file) + "_" + hasher.hexdigest() + ".stpd" stpd = self.cache_dir + '/' + os.path.basename(self.ammo_file) + "_" + hasher.hexdigest() + ".stpd"
self.log.debug("Generated cache file name: %s", stpd) self.log.debug("Generated cache file name: %s", stpd)
else: else:

View File

@ -1,7 +1,7 @@
from Monitoring.collector import MonitoringCollector
from Tests.TankTests import TankTestCase from Tests.TankTests import TankTestCase
import tempfile import tempfile
import time import time
from MonCollector.collector import MonitoringCollector
class MonitoringCollectorTestCase(TankTestCase): class MonitoringCollectorTestCase(TankTestCase):
data = None data = None