luci-app-statistics: CPU plugin: backport defaults from master
authorHannu Nyman <hannu.nyman@iki.fi>
Sun, 8 Nov 2020 16:26:20 +0000 (18:26 +0200)
committerHannu Nyman <hannu.nyman@iki.fi>
Sun, 8 Nov 2020 16:32:46 +0000 (18:32 +0200)
Backport from master the current defaults based on 1cff1002.
(The part related to 'idle' state is not backported, yet)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/cpu.lua
applications/luci-app-statistics/root/etc/config/luci_statistics

index 56af1cc96a96fce73bfbf64bd2ad51de185ca6af..a68ebd3b46aad8075778af64718b29eec25f7bb8 100644 (file)
@@ -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
index dc515e35cbb1083fb9ed914acbe68285ecce9127..1ab03f99e557d288647b162491b1ea550fa06573 100644 (file)
@@ -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'