From 7460e9d7203b63d4d123e0ea40cc9e0f8585346c Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 8 Nov 2020 18:26:20 +0200 Subject: [PATCH] luci-app-statistics: CPU plugin: backport defaults from master Backport from master the current defaults based on 1cff1002. (The part related to 'idle' state is not backported, yet) Signed-off-by: Hannu Nyman --- .../luasrc/model/cbi/luci_statistics/cpu.lua | 5 ++++- .../luci-app-statistics/root/etc/config/luci_statistics | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/cpu.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/cpu.lua index 56af1cc96a..a68ebd3b46 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/cpu.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/cpu.lua @@ -17,6 +17,7 @@ reportbycpu = s:option( Flag, "ReportByCpu", translate("Report by CPU"), translate("By setting this, CPU is not aggregate of all processors on the system")) reportbycpu.default = 1 +reportbycpu.rmempty = false reportbycpu:depends( "enable", 1 ) -- collectd_cpu.reportbystate (ReportByState) @@ -24,13 +25,15 @@ reportbystate = s:option( Flag, "ReportByState", translate("Report by state"), translate("When set to true, reports per-state metric (system, user, idle)")) reportbystate.default = 1 +reportbystate.rmempty = false reportbystate:depends( "enable", 1 ) -- collectd_cpu.valuespercentage (ValuesPercentage) valuespercentage = s:option( Flag, "ValuesPercentage", translate("Report in percent"), translate("When set to true, we request percentage values")) -valuespercentage.default = 0 +valuespercentage.default = 1 +valuespercentage.rmempty = false valuespercentage:depends({ enable = 1, ReportByCpu = 1, ReportByState = 1 }) return m diff --git a/applications/luci-app-statistics/root/etc/config/luci_statistics b/applications/luci-app-statistics/root/etc/config/luci_statistics index dc515e35cb..1ab03f99e5 100644 --- a/applications/luci-app-statistics/root/etc/config/luci_statistics +++ b/applications/luci-app-statistics/root/etc/config/luci_statistics @@ -62,6 +62,9 @@ config statistics 'collectd_contextswitch' config statistics 'collectd_cpu' option enable '1' + option ReportByCpu '1' + option ReportByState '1' + option ValuesPercentage '1' config statistics 'collectd_cpufreq' option enable '0' -- 2.30.2