luci-app-olsr: handle empty result for non-status tables
[oweals/luci.git] / applications / luci-app-statistics / luasrc / statistics / rrdtool / definitions / 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 module("luci.statistics.rrdtool.definitions.cpu",package.seeall)
5
6 function item()
7         return luci.i18n.translate("Processor")
8 end
9
10 function rrdargs( graph, plugin, plugin_instance, dtype )
11
12         return {
13                 title = "%H: Processor usage on core #%pi",
14                 y_min = "0",
15                 alt_autoscale_max = true,
16                 vlabel = "Percent",
17                 number_format = "%5.1lf%%",
18                 data = {
19                         instances = { 
20                                 cpu = { "user", "nice", "system", "softirq", "interrupt" }
21                         },
22
23                         options = {
24                                 cpu_idle      = { color = "ffffff", title = "Idle" },
25                                 cpu_nice      = { color = "00e000", title = "Nice" },
26                                 cpu_user      = { color = "0000ff", title = "User" },
27                                 cpu_wait      = { color = "ffb000", title = "Wait" },
28                                 cpu_system    = { color = "ff0000", title = "System" },
29                                 cpu_softirq   = { color = "ff00ff", title = "Softirq" },
30                                 cpu_interrupt = { color = "a000a0", title = "Interrupt" },
31                                 cpu_steal     = { color = "000000", title = "Steal" }
32                         }
33                 }
34         }
35 end