17f1e2b991b75439e06be02eafa2efe1d58eb3cd
[project/luci.git] / applications / luci-statistics / luasrc / statistics / rrdtool / definitions / processes.lua
1 module("luci.statistics.rrdtool.definitions.processes", package.seeall)
2
3 function rrdargs( graph, plugin, plugin_instance )
4
5         if plugin_instance == "" then
6                 return {
7                         data = {
8                                 instances = {
9                                         ps_state = {
10                                                 "sleeping", "running", "paging", "blocked", "stopped", "zombies"
11                                         }
12                                 },
13
14                                 options = {
15                                         ps_state_sleeping = { color = "0000ff" },
16                                         ps_state_running  = { color = "008000" },
17                                         ps_state_paging   = { color = "ffff00" },
18                                         ps_state_blocked  = { color = "ff5000" },
19                                         ps_state_stopped  = { color = "555555" },
20                                         ps_state_zombies  = { color = "ff0000" }
21                                 }
22                         }
23                 }
24         else
25                 return {
26
27                         {
28                                 data = {
29                                         sources = {
30                                                 ps_cputime = { "syst", "user" }
31                                         },
32
33                                         options = {
34                                                 ps_cputime__user = {
35                                                         color   = "0000ff",
36                                                         overlay = true
37                                                 },
38
39                                                 ps_cputime__syst = {
40                                                         color   = "ff0000",
41                                                         overlay = true
42                                                 }
43                                         }
44                                 }
45                         },
46
47                         {
48                                 data = {
49                                         sources = {
50                                                 ps_count = { "threads", "processes" }
51                                         },
52
53                                         options = {
54                                                 ps_count__threads   = { color = "00ff00" },
55                                                 ps_count__processes = { color = "0000bb" }
56                                         }
57                                 }
58                         },
59
60                         {
61                                 data = {
62                                         sources = {
63                                                 ps_pagefaults = { "minflt", "majflt" }
64                                         },
65
66                                         options = {
67                                                 ps_pagefaults__minflt = { color = "ff0000" },
68                                                 ps_pagefaults__majflt = { color = "ff5500" }
69                                         }
70                                 }
71                         },
72
73                         {
74                                 number_format = "%5.1lf%s",
75
76                                 data = {
77                                         types = { "ps_rss" },
78
79                                         options = {
80                                                 ps_rss = { color = "0000ff" }
81                                         }
82                                 }
83                         }
84                 }
85         end
86 end