Merge pull request #1735 from sumpfralle/olsr-jsoninfo-parser-handle-empty-result
[oweals/luci.git] / applications / luci-app-statistics / luasrc / model / cbi / luci_statistics / cpu.lua
1 -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
3
4 m = Map("luci_statistics",
5         translate("CPU Plugin Configuration"),
6         translate("The cpu plugin collects basic statistics about the processor usage."))
7
8 -- collectd_cpu config section
9 s = m:section( NamedSection, "collectd_cpu", "luci_statistics" )
10
11 -- collectd_cpu.enable
12 enable = s:option( Flag, "enable", translate("Enable this plugin") )
13 enable.default = 0
14
15 -- collectd_cpu.reportbycpu (ReportByCpu)
16 reportbycpu = s:option( Flag, "ReportByCpu",
17         translate("Report by CPU"),
18         translate("By setting this, CPU is not aggregate of all processors on the system"))
19 reportbycpu.default = 1
20 reportbycpu:depends( "enable", 1 )
21
22 -- collectd_cpu.reportbystate (ReportByState)
23 reportbystate = s:option( Flag, "ReportByState",
24         translate("Report by state"),
25         translate("When set to true, reports per-state metric (system, user, idle)"))
26 reportbystate.default = 1
27 reportbystate:depends( "enable", 1 )
28
29 -- collectd_cpu.valuespercentage (ValuesPercentage)
30 valuespercentage = s:option( Flag, "ValuesPercentage",
31         translate("Report in percent"),
32         translate("When set to true, we request percentage values"))
33 valuespercentage.default = 0
34 valuespercentage:depends({ enable = 1, ReportByCpu = 1, ReportByState = 1 })
35
36 return m