diff --git a/bin/linspector b/bin/linspector index 67ed320..5283fec 100755 --- a/bin/linspector +++ b/bin/linspector @@ -18,7 +18,7 @@ from linspector.core.monitors import Monitors # i currently only increase the 3rd number because the goal is that 0.19.* will become the first # stable version. -__version__ = '0.19.63.dev1' +__version__ = '0.19.64.dev1' __author__ = 'Johannes Findeisen ' diff --git a/linspector/core/monitors.py b/linspector/core/monitors.py index 6712302..5a651a5 100644 --- a/linspector/core/monitors.py +++ b/linspector/core/monitors.py @@ -46,7 +46,7 @@ class Monitors: if kwargs: log.debug(identifier + ' args ' + str(kwargs)) - identifier = monitor_group + '_' + os.path.splitext(os.path.basename( + identifier = monitor_group + '.' + os.path.splitext(os.path.basename( monitor_file))[0] # create Monitor() object and copy monitor_configuration for each instance because diff --git a/linspector/core/task.py b/linspector/core/task.py index 246b3e3..a1ceae0 100644 --- a/linspector/core/task.py +++ b/linspector/core/task.py @@ -63,17 +63,19 @@ class Task: # i believe the singleton pattern is not required here because all tasks are stored as singleton in # a dict already, and they can be executed directly in the equivalent monitor. need to discover this -# when tasks are being implemented. +# when tasks are being implemented. this is from the old version of Linspector... +# UPDATE: i see that task runners should be executed as separate threads, so maybe they should be +# singleton here to not instantiate more than one instance inside each task. don't know actually... @Singleton -class TaskExecutor: +class TaskRunner: def __init__(self, configuration, environment, log): self.__configuration = configuration self.__environment = environment self.__log = log self.queue = Queue() - self.taskInfos = [] + self.task_infos = [] task_thread = Thread(target=self._run_worker_thread) - self._instantEnd = False + self._instant_end = False self._running = True task_thread.daemon = True task_thread.start() @@ -92,7 +94,7 @@ class TaskExecutor: self.__log.error('error ' + str(err)) def is_instant_end(self): - return self._instantEnd + return self._instant_end def is_running(self): return self._running @@ -102,7 +104,7 @@ class TaskExecutor: def stop_immediately(self): self._running = False - self._instantEnd = True + self._instant_end = True def schedule_task(self, msg, task): self.queue.put((msg, task))