6f83c8e283bef3cc31452324abe9a50ea796f3f0
[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, dtype )
19
20 return {
21 {
22 title = "%H: Processes",
23 vlabel = "Processes/s",
24 data = {
25 instances = {
26 ps_state = {
27 "sleeping", "running", "paging", "blocked", "stopped", "zombies"
28 }
29 },
30
31 options = {
32 ps_state_sleeping = { color = "0000ff" },
33 ps_state_running = { color = "008000" },
34 ps_state_paging = { color = "ffff00" },
35 ps_state_blocked = { color = "ff5000" },
36 ps_state_stopped = { color = "555555" },
37 ps_state_zombies = { color = "ff0000" }
38 }
39 }
40 },
41
42 {
43 title = "%H: CPU time used by %pi",
44 vlabel = "Jiffies",
45 data = {
46 sources = {
47 ps_cputime = { "syst", "user" }
48 },
49
50 options = {
51 ps_cputime__user = {
52 color = "0000ff",
53 overlay = true
54 },
55
56 ps_cputime__syst = {
57 color = "ff0000",
58 overlay = true
59 }
60 }
61 }
62 },
63
64 {
65 title = "%H: Threads and processes belonging to %pi",
66 vlabel = "Count",
67 detail = true,
68 data = {
69 sources = {
70 ps_count = { "threads", "processes" }
71 },
72
73 options = {
74 ps_count__threads = { color = "00ff00" },
75 ps_count__processes = { color = "0000bb" }
76 }
77 }
78 },
79
80 {
81 title = "%H: Page faults in %pi",
82 vlabel = "Pagefaults",
83 detail = true,
84 data = {
85 sources = {
86 ps_pagefaults = { "minflt", "majflt" }
87 },
88
89 options = {
90 ps_pagefaults__minflt = { color = "ff0000" },
91 ps_pagefaults__majflt = { color = "ff5500" }
92 }
93 }
94 },
95
96 {
97 title = "%H: Virtual memory size of %pi",
98 vlabel = "Bytes",
99 detail = true,
100 number_format = "%5.1lf%sB",
101 data = {
102 types = { "ps_rss" },
103
104 options = {
105 ps_rss = { color = "0000ff" }
106 }
107 }
108 }
109 }
110 end