summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2020-11-08 09:29:03 +0200
committerHannu Nyman <hannu.nyman@iki.fi>2020-11-08 09:29:03 +0200
commit1cff10022156ad290b131ea0d5bb9b83e0db5cf2 (patch)
tree8c39ea7ae5f0dc70e4c752551a985936374a7fe6 /applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions
parent167435b094903a4557371de44fdbc12bf4b61955 (diff)
luci-app-statistics: CPU plugin: hide 'idle', tweak defaults
* Add functionality to hide the metric of 'idle' state from the chart and data table. Many routers are mostly idle, and the 98% 'idle' dominates the graph reducing its usefulness. Without 'idle', the smaller CPU usage spikes are visible. * Hide 'idle' by default. Provide config option to show it. (note: the option in inside LuCI, and has no impact on actual data collection by collectd.) * Tweak the defaults to use the percentage data by default. It makes more sense to average users than jiffies. * Set the current LuCI defaults also in the config file. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Diffstat (limited to 'applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions')
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js
index 464b28e8ef..7d0dc9a15a 100644
--- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpu.js
@@ -15,6 +15,8 @@ return baseclass.extend({
if (plugin_instance != '')
title = "%H: Processor usage on core #%pi";
+ var show_idle = uci.get("luci_statistics", "collectd_cpu", "ShowIdle") == "1" ? true : false;
+
if (uci.get("luci_statistics", "collectd_cpu", "ReportByState") == "1") {
var cpu = {
title: title,
@@ -25,7 +27,7 @@ return baseclass.extend({
data: {
instances: {
cpu: [
- "idle",
+ ...(show_idle ? ["idle"] : []),
"interrupt",
"nice",
"softirq",
@@ -81,7 +83,7 @@ return baseclass.extend({
data: {
instances: {
percent: [
- "idle",
+ ...(show_idle ? ["idle"] : []),
"interrupt",
"nice",
"softirq",