Exemple #1
0
 def __init__(self, root, resource_monitor_class=TaskResourceMonitor):
   self._pathspec = TaskPath(root=root)
   self._detector = TaskDetector(root)
   if not issubclass(resource_monitor_class, ResourceMonitorBase):
     raise ValueError("resource monitor class must implement ResourceMonitorBase!")
   self._resource_monitor = resource_monitor_class
   self._active_tasks = {}    # task_id => ActiveObservedTask
   self._finished_tasks = {}  # task_id => FinishedObservedTask
   self._stop_event = threading.Event()
   ExceptionalThread.__init__(self)
   Lockable.__init__(self)
   self.daemon = True
 def __init__(self, root, resource_monitor_class=TaskResourceMonitor):
   self._pathspec = TaskPath(root=root)
   self._detector = TaskDetector(root)
   if not issubclass(resource_monitor_class, ResourceMonitorBase):
     raise ValueError("resource monitor class must implement ResourceMonitorBase!")
   self._resource_monitor = resource_monitor_class
   self._active_tasks = {}    # task_id => ActiveObservedTask
   self._finished_tasks = {}  # task_id => FinishedObservedTask
   self._stop_event = threading.Event()
   ExceptionalThread.__init__(self)
   Lockable.__init__(self)
   self.daemon = True
Exemple #3
0
 def __init__(self,
              path_detector,
              resource_monitor_class=TaskResourceMonitor,
              interval=POLLING_INTERVAL):
   self._detector = ObserverTaskDetector(
       path_detector,
       self.__on_active,
       self.__on_finished,
       self.__on_removed)
   if not issubclass(resource_monitor_class, ResourceMonitorBase):
     raise ValueError("resource monitor class must implement ResourceMonitorBase!")
   self._resource_monitor_class = resource_monitor_class
   self._interval = interval
   self._active_tasks = {}    # task_id => ActiveObservedTask
   self._finished_tasks = {}  # task_id => FinishedObservedTask
   self._stop_event = threading.Event()
   ExceptionalThread.__init__(self)
   Lockable.__init__(self)
   self.daemon = True
Exemple #4
0
 def __init__(self,
              path_detector,
              interval=POLLING_INTERVAL,
              task_process_collection_interval=TaskResourceMonitor.PROCESS_COLLECTION_INTERVAL,
              task_disk_collection_interval=TaskResourceMonitor.DISK_COLLECTION_INTERVAL):
   self._detector = ObserverTaskDetector(
       path_detector,
       self.__on_active,
       self.__on_finished,
       self.__on_removed)
   self._interval = interval
   self._task_process_collection_interval = task_process_collection_interval
   self._task_disk_collection_interval = task_disk_collection_interval
   self._active_tasks = {}    # task_id => ActiveObservedTask
   self._finished_tasks = {}  # task_id => FinishedObservedTask
   self._stop_event = threading.Event()
   ExceptionalThread.__init__(self)
   Lockable.__init__(self)
   self.daemon = True
Exemple #5
0
    def __init__(self,
                 path_detector,
                 interval=POLLING_INTERVAL,
                 task_process_collection_interval=TaskResourceMonitor.
                 PROCESS_COLLECTION_INTERVAL,
                 enable_mesos_disk_collector=False,
                 disk_collector_settings=DiskCollectorSettings()):

        self._detector = ObserverTaskDetector(path_detector, self.__on_active,
                                              self.__on_finished,
                                              self.__on_removed)
        self._interval = interval
        self._task_process_collection_interval = task_process_collection_interval
        self._enable_mesos_disk_collector = enable_mesos_disk_collector
        self._disk_collector_settings = disk_collector_settings
        self._active_tasks = {}  # task_id => ActiveObservedTask
        self._finished_tasks = {}  # task_id => FinishedObservedTask
        self._stop_event = threading.Event()
        ExceptionalThread.__init__(self)
        Lockable.__init__(self)
        self.daemon = True
Exemple #6
0
 def __init__(self):
     self.counter = 0
     self.start_event = threading.Event()
     self.finish_event = threading.Event()
     Lockable.__init__(self)
Exemple #7
0
 def __init__(self):
   self.counter = 0
   self.start_event = threading.Event()
   self.finish_event = threading.Event()
   Lockable.__init__(self)