* luci/statistics: added missing iptables/ipt_bytes definition, svn property fixups
[project/luci.git] / applications / luci-statistics / luasrc / statistics / rrdtool / definitions / processes.lua
1 --[[
2
3 Luci statistics - processes plugin diagram definition
4 (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 ]]--
15
16 module("luci.statistics.rrdtool.definitions.processes", package.seeall)
17
18 function rrdargs( graph, plugin, plugin_instance )
19
20         if plugin_instance == "" then
21                 return {
22                         data = {
23                                 instances = {
24                                         ps_state = {
25                                                 "sleeping", "running", "paging", "blocked", "stopped", "zombies"
26                                         }
27                                 },
28
29                                 options = {
30                                         ps_state_sleeping = { color = "0000ff" },
31                                         ps_state_running  = { color = "008000" },
32                                         ps_state_paging   = { color = "ffff00" },
33                                         ps_state_blocked  = { color = "ff5000" },
34                                         ps_state_stopped  = { color = "555555" },
35                                         ps_state_zombies  = { color = "ff0000" }
36                                 }
37                         }
38                 }
39         else
40                 return {
41
42                         {
43                                 data = {
44                                         sources = {
45                                                 ps_cputime = { "syst", "user" }
46                                         },
47
48                                         options = {
49                                                 ps_cputime__user = {
50                                                         color   = "0000ff",
51                                                         overlay = true
52                                                 },
53
54                                                 ps_cputime__syst = {
55                                                         color   = "ff0000",
56                                                         overlay = true
57                                                 }
58                                         }
59                                 }
60                         },
61
62                         {
63                                 data = {
64                                         sources = {
65                                                 ps_count = { "threads", "processes" }
66                                         },
67
68                                         options = {
69                                                 ps_count__threads   = { color = "00ff00" },
70                                                 ps_count__processes = { color = "0000bb" }
71                                         }
72                                 }
73                         },
74
75                         {
76                                 data = {
77                                         sources = {
78                                                 ps_pagefaults = { "minflt", "majflt" }
79                                         },
80
81                                         options = {
82                                                 ps_pagefaults__minflt = { color = "ff0000" },
83                                                 ps_pagefaults__majflt = { color = "ff5500" }
84                                         }
85                                 }
86                         },
87
88                         {
89                                 number_format = "%5.1lf%s",
90
91                                 data = {
92                                         types = { "ps_rss" },
93
94                                         options = {
95                                                 ps_rss = { color = "0000ff" }
96                                         }
97                                 }
98                         }
99                 }
100         end
101 end