add some indirection around make targets of module.mk, so you can combine it more...
[project/luci.git] / applications / luci-statistics / src / statistics / rrdtool / definitions / processes / ps_state.lua
1 module("luci.statistics.rrdtool.definitions.processes.ps_state", package.seeall)
2
3 function rrdargs( graph, host, plugin, plugin_instance, dtype )
4
5         dtype_instances = {
6                 "sleeping", "running", "paging", "blocked", "stopped", "zombies"
7         }
8
9         opts = { }
10         opts.sources    = { }
11         opts.image      = graph:mkpngpath( host, plugin, plugin_instance, dtype )
12         opts.title      = host .. ": Prozesse"
13         opts.rrd        = { "-v", "Anzahl" }
14         opts.colors     = { 
15                 sleeping = "008080",
16                 running  = "008000",
17                 paging   = "ffff00",
18                 blocked  = "ff5000",
19                 stopped  = "555555",
20                 zombies  = "ff0000"
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, "ps_state", inst )
27                 }
28         end
29
30         return opts
31 end