]> arthur.barton.de Git - netdata.git/blobdiff - charts.d/load_average.chart.sh
added a new element on all charts: context, which is the template upon the chart...
[netdata.git] / charts.d / load_average.chart.sh
index 6e5d5e05728aceabe6c68125645354d60dc8d78f..8cc5af6ec6c98895e69a4ffe851d362b5d034f77 100755 (executable)
@@ -1,19 +1,27 @@
 #!/bin/sh
 
-load_average_update_every=
+load_average_update_every=5
+load_priority=100
 
 load_average_check() {
        # this should return:
        #  - 0 to enable the chart
        #  - 1 to disable the chart
 
+       if [ ${load_average_update_every} -lt 5 ]
+               then
+               # there is no meaning for shorter than 5 seconds
+               # the kernel changes this value every 5 seconds
+               load_average_update_every=5
+       fi
+
        return 0
 }
 
 load_average_create() {
        # create a chart with 3 dimensions
 cat <<EOF
-CHART example.load '' "System Load Average" "load" load load line 500 $load_average_update_every
+CHART system.load '' "System Load Average" "load" load system.load line $[load_priority + 1] $load_average_update_every
 DIMENSION load1 '1 min' absolute 1 100
 DIMENSION load5 '5 mins' absolute 1 100
 DIMENSION load15 '15 mins' absolute 1 100
@@ -37,7 +45,7 @@ load_average_update() {
 
        # write the result of the work.
        cat <<VALUESEOF
-BEGIN example.load
+BEGIN system.load
 SET load1 = $load1
 SET load5 = $load5
 SET load15 = $load15