summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/example/example.chart.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-31 12:58:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-03-31 12:58:11 +0000
commitf99c4526d94d3e04124c5c48ab4a3da6ca53a458 (patch)
treea2ed8860030cc49f492b09b3222d593c65619800 /collectors/python.d.plugin/example/example.chart.py
parentAdding upstream version 1.29.3. (diff)
downloadnetdata-f99c4526d94d3e04124c5c48ab4a3da6ca53a458.tar.xz
netdata-f99c4526d94d3e04124c5c48ab4a3da6ca53a458.zip
Adding upstream version 1.30.0.upstream/1.30.0
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.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/collectors/python.d.plugin/example/example.chart.py b/collectors/python.d.plugin/example/example.chart.py
index 61ae47f22..d6c0b6658 100644
--- a/collectors/python.d.plugin/example/example.chart.py
+++ b/collectors/python.d.plugin/example/example.chart.py
@@ -29,6 +29,9 @@ class Service(SimpleService):
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():
@@ -37,12 +40,12 @@ class Service(SimpleService):
def get_data(self):
data = dict()
- for i in range(1, 4):
+ 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(0, 100)
+ data[dimension_id] = self.random.randint(self.lower, self.upper)
return data