commit 4f6198094cf4134179d1f9c9fa8f79759a27c87e
[project/luci.git] / applications / luci-statistics / luasrc / statistics / rrdtool / definitions / cpu / cpu.lua
1 module("luci.statistics.rrdtool.definitions.cpu.cpu",package.seeall)
2
3 function rrdargs( graph, host, plugin, plugin_instance, dtype )
4
5         dtype_instances = { "idle", "nice", "system", "user" }
6
7         opts = { }
8         opts.sources    = { }
9         opts.image      = graph:mkpngpath( host, plugin, plugin_instance, dtype )
10         opts.title      = host .. ": Prozessorauslastung"
11         opts.rrd        = { "-v", "Percent" }
12         opts.colors     = {
13                 idle      = 'ffffff',
14                 nice      = '00e000',
15                 user      = '0000ff',
16                 wait      = 'ffb000',
17                 system    = 'ff0000',
18                 softirq   = 'ff00ff',
19                 interrupt = 'a000a0',
20                 steal     = '000000'
21         }
22
23         for i, inst in ipairs(dtype_instances) do
24                 opts.sources[i] = {
25                         name = inst,
26                         rrd  = graph:mkrrdpath( host, plugin, plugin_instance, dtype, inst )
27                 }
28         end
29
30         return opts
31 end