summaryrefslogtreecommitdiffstats
path: root/collectors/charts.d.plugin/example
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-08 07:30:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-08 07:30:37 +0000
commit8a7b72f7cd1ccd547a03eb4243294e741d661d3f (patch)
tree7bc7be4a8e9e298daa1349348400aa2a653866f2 /collectors/charts.d.plugin/example
parentNew upstream version 1.11.1+dfsg (diff)
downloadnetdata-8a7b72f7cd1ccd547a03eb4243294e741d661d3f.tar.xz
netdata-8a7b72f7cd1ccd547a03eb4243294e741d661d3f.zip
Adding upstream version 1.12.0.upstream/1.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/charts.d.plugin/example')
-rw-r--r--collectors/charts.d.plugin/example/README.md4
-rw-r--r--collectors/charts.d.plugin/example/example.chart.sh15
2 files changed, 10 insertions, 9 deletions
diff --git a/collectors/charts.d.plugin/example/README.md b/collectors/charts.d.plugin/example/README.md
index bfd5e210a..e62f76777 100644
--- a/collectors/charts.d.plugin/example/README.md
+++ b/collectors/charts.d.plugin/example/README.md
@@ -1,2 +1,6 @@
+# Example
+
This is just an example charts.d data collector.
+
+[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fcharts.d.plugin%2Fexample%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)]()
diff --git a/collectors/charts.d.plugin/example/example.chart.sh b/collectors/charts.d.plugin/example/example.chart.sh
index 1562c597a..8bae570a3 100644
--- a/collectors/charts.d.plugin/example/example.chart.sh
+++ b/collectors/charts.d.plugin/example/example.chart.sh
@@ -44,23 +44,20 @@ example_get() {
example_value1=$RANDOM
example_value2=$RANDOM
example_value3=$RANDOM
- example_value4=$((8192 + (RANDOM * 16383 / 32767) ))
+ example_value4=$((8192 + (RANDOM * 16383 / 32767)))
- if [ $example_count -gt 0 ]
- then
+ if [ $example_count -gt 0 ]; then
example_count=$((example_count - 1))
- [ $example_last -gt 16383 ] && example_value4=$((example_last + (RANDOM * ( (32767 - example_last) / 2) / 32767)))
+ [ $example_last -gt 16383 ] && example_value4=$((example_last + (RANDOM * ((32767 - example_last) / 2) / 32767)))
[ $example_last -le 16383 ] && example_value4=$((example_last - (RANDOM * (example_last / 2) / 32767)))
else
- example_count=$((1 + (RANDOM * 5 / 32767) ))
+ example_count=$((1 + (RANDOM * 5 / 32767)))
- if [ $example_last -gt 16383 ] && [ $example_value4 -gt 16383 ]
- then
+ if [ $example_last -gt 16383 ] && [ $example_value4 -gt 16383 ]; then
example_value4=$((example_value4 - 16383))
fi
- if [ $example_last -le 16383 ] && [ $example_value4 -lt 16383 ]
- then
+ if [ $example_last -le 16383 ] && [ $example_value4 -lt 16383 ]; then
example_value4=$((example_value4 + 16383))
fi
fi