Merge pull request #1139 from fantom-x/luci-app-hd-idle-menu-item
[project/luci.git] / applications / luci-app-statistics / luasrc / statistics / rrdtool / definitions / processes.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.processes", package.seeall)
5
6 function rrdargs( graph, plugin, plugin_instance, dtype )
7
8         return {
9                 {
10                         title = "%H: Processes",
11                         vlabel = "Processes/s",
12                         data = {
13                                 instances = {
14                                         ps_state = {
15                                                 "sleeping", "running", "paging",
16                                                 "blocked", "stopped", "zombies"
17                                         }
18                                 },
19
20                                 options = {
21                                         ps_state_sleeping = { color = "0000ff", title = "Sleeping" },
22                                         ps_state_running  = { color = "008000", title = "Running" },
23                                         ps_state_paging   = { color = "ffff00", title = "Paging" },
24                                         ps_state_blocked  = { color = "ff5000", title = "Blocked" },
25                                         ps_state_stopped  = { color = "555555", title = "Stopped" },
26                                         ps_state_zombies  = { color = "ff0000", title = "Zombies" }
27                                 }
28                         }
29                 },
30
31                 {
32                         title = "%H: CPU time used by %pi",
33                         vlabel = "Jiffies",
34                         data = {
35                                 sources = {
36                                         ps_cputime = { "syst", "user" }
37                                 },
38
39                                 options = {
40                                         ps_cputime__user = {
41                                                 color   = "0000ff",
42                                                 title   = "User",
43                                                 overlay = true
44                                         },
45
46                                         ps_cputime__syst = {
47                                                 color   = "ff0000",
48                                                 title   = "System",
49                                                 overlay = true
50                                         }
51                                 }
52                         }
53                 },
54
55                 {
56                         title = "%H: Threads and processes belonging to %pi",
57                         vlabel = "Count",
58                         detail = true,
59                         data = {
60                                 sources = {
61                                         ps_count = { "threads", "processes" }
62                                 },
63
64                                 options = {
65                                         ps_count__threads   = { color = "00ff00", title = "Threads" },
66                                         ps_count__processes = { color = "0000bb", title = "Processes" }
67                                 }
68                         }
69                 },
70
71                 {
72                         title = "%H: Page faults in %pi",
73                         vlabel = "Page faults",
74                         detail = true,
75                         data = {
76                                 sources = {
77                                         ps_pagefaults = { "minflt", "majflt" }
78                                 },
79
80                                 options = {
81                                         ps_pagefaults__minflt = { color = "0000ff", title = "Minor" },
82                                         ps_pagefaults__majflt = { color = "ff0000", title = "Major" }
83                                 }
84                         }
85                 },
86
87                 {
88                         title = "%H: Resident segment size (RSS) of %pi",
89                         vlabel = "Bytes",
90                         detail = true,
91                         number_format = "%5.1lf%sB",
92                         data = {
93                                 types = { "ps_rss" },
94
95                                 options = {
96                                         ps_rss = { color = "0000ff", title = "Resident segment" }
97                                 }
98                         }
99                 },
100
101                 {
102                         title = "%H: Virtual memory size (VSZ) of %pi",
103                         vlabel = "Bytes",
104                         detail = true,
105                         number_format = "%5.1lf%sB",
106                         data = {
107                                 types = { "ps_vm" },
108
109                                 options = {
110                                         ps_vm = { color = "0000ff", title = "Virtual memory" }
111                                 }
112                         }
113                 }
114         }
115 end