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
index 26d5f07c845bffcdee166bfea5d2f74a2320717b..56af1cc96a96fce73bfbf64bd2ad51de185ca6af 100644 (file)
@@ -1,17 +1,5 @@
---[[
-
-Luci configuration model for statistics - collectd cpu plugin configuration
-(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
+-- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org>
+-- Licensed to the public under the Apache License 2.0.
 
 m = Map("luci_statistics",
        translate("CPU Plugin Configuration"),
@@ -24,4 +12,25 @@ s = m:section( NamedSection, "collectd_cpu", "luci_statistics" )
 enable = s:option( Flag, "enable", translate("Enable this plugin") )
 enable.default = 0
 
+-- collectd_cpu.reportbycpu (ReportByCpu)
+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:depends( "enable", 1 )
+
+-- collectd_cpu.reportbystate (ReportByState)
+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: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:depends({ enable = 1, ReportByCpu = 1, ReportByState = 1 })
+
 return m