diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:54:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:54:44 +0000 |
commit | 836b47cb7e99a977c5a23b059ca1d0b5065d310e (patch) | |
tree | 1604da8f482d02effa033c94a84be42bc0c848c3 /collectors/python.d.plugin/example/example.chart.py | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.tar.xz netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.zip |
Merging upstream version 1.46.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/python.d.plugin/example/example.chart.py')
-rw-r--r-- | collectors/python.d.plugin/example/example.chart.py | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/collectors/python.d.plugin/example/example.chart.py b/collectors/python.d.plugin/example/example.chart.py deleted file mode 100644 index d6c0b665..00000000 --- a/collectors/python.d.plugin/example/example.chart.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# Description: example netdata python.d module -# Author: Put your name here (your github login) -# SPDX-License-Identifier: GPL-3.0-or-later - -from random import SystemRandom - -from bases.FrameworkServices.SimpleService import SimpleService - -priority = 90000 - -ORDER = [ - 'random', -] - -CHARTS = { - 'random': { - 'options': [None, 'A random number', 'random number', 'random', 'random', 'line'], - 'lines': [ - ['random1'] - ] - } -} - - -class Service(SimpleService): - def __init__(self, configuration=None, name=None): - SimpleService.__init__(self, configuration=configuration, name=name) - self.order = ORDER - self.definitions = CHARTS - self.random = SystemRandom() - self.num_lines = self.configuration.get('num_lines', 4) - self.lower = self.configuration.get('lower', 0) - self.upper = self.configuration.get('upper', 100) - - @staticmethod - def check(): - return True - - def get_data(self): - data = dict() - - for i in range(0, self.num_lines): - dimension_id = ''.join(['random', str(i)]) - - if dimension_id not in self.charts['random']: - self.charts['random'].add_dimension([dimension_id]) - - data[dimension_id] = self.random.randint(self.lower, self.upper) - - return data |