From 50485bedfd9818165aa1d039d0abe95a559134b7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 8 Feb 2019 08:31:03 +0100 Subject: Merging upstream version 1.12.0. Signed-off-by: Daniel Baumann --- collectors/charts.d.plugin/example/README.md | 4 ++++ collectors/charts.d.plugin/example/example.chart.sh | 15 ++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'collectors/charts.d.plugin/example') 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 -- cgit v1.2.3