diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-03-16 07:50:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-03-16 07:50:20 +0000 |
commit | b26be28df9fd4db2106cc2a557966c9d2a7345d9 (patch) | |
tree | 437e6106c0aa2e73f2dd68d0551545ae503f60d7 /collectors/python.d.plugin/python_modules/bases/FrameworkServices/SimpleService.py | |
parent | Adding upstream version 1.12.2. (diff) | |
download | netdata-b26be28df9fd4db2106cc2a557966c9d2a7345d9.tar.xz netdata-b26be28df9fd4db2106cc2a557966c9d2a7345d9.zip |
Adding upstream version 1.13.0.upstream/1.13.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/python.d.plugin/python_modules/bases/FrameworkServices/SimpleService.py')
-rw-r--r-- | collectors/python.d.plugin/python_modules/bases/FrameworkServices/SimpleService.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/collectors/python.d.plugin/python_modules/bases/FrameworkServices/SimpleService.py b/collectors/python.d.plugin/python_modules/bases/FrameworkServices/SimpleService.py index c7ab7f244..4c1d6ba64 100644 --- a/collectors/python.d.plugin/python_modules/bases/FrameworkServices/SimpleService.py +++ b/collectors/python.d.plugin/python_modules/bases/FrameworkServices/SimpleService.py @@ -4,13 +4,13 @@ # Author: Ilya Mashchenko (l2isbad) # SPDX-License-Identifier: GPL-3.0-or-later -from threading import Thread + from time import sleep, time from third_party.monotonic import monotonic from bases.charts import Charts, ChartError, create_runtime_chart -from bases.collection import OldVersionCompatibility, safe_print +from bases.collection import safe_print from bases.loggers import PythonDLimitedLogger RUNTIME_CHART_UPDATE = 'BEGIN netdata.runtime_{job_name} {since_last}\n' \ @@ -55,7 +55,7 @@ class RuntimeCounters: self.penalty = round(min(self.retries * self.update_every / 2, MAX_PENALTY)) -class SimpleService(Thread, PythonDLimitedLogger, OldVersionCompatibility, object): +class SimpleService(PythonDLimitedLogger, object): """ Prototype of Service class. Implemented basic functionality to run jobs by `python.d.plugin` @@ -65,10 +65,7 @@ class SimpleService(Thread, PythonDLimitedLogger, OldVersionCompatibility, objec :param configuration: <dict> :param name: <str> """ - Thread.__init__(self) - self.daemon = True PythonDLimitedLogger.__init__(self) - OldVersionCompatibility.__init__(self) self.configuration = configuration self.order = list() self.definitions = dict() @@ -91,7 +88,7 @@ class SimpleService(Thread, PythonDLimitedLogger, OldVersionCompatibility, objec @property def name(self): - if self.job_name: + if self.job_name and self.job_name != self.module_name: return '_'.join([self.module_name, self.override_name or self.job_name]) return self.module_name |