luci-app-statistics: fix whitespaces in rrdtool definitions
[project/luci.git] / applications / luci-app-statistics / luasrc / statistics / rrdtool / definitions / netlink.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.netlink", package.seeall)
5
6 function rrdargs( graph, plugin, plugin_instance )
7
8 --
9 -- traffic diagram
10 --
11 local traffic = {
12 title = "%H: Netlink - Transfer on %pi",
13 vlabel = "Bytes/s",
14
15 -- diagram data description
16 data = {
17 -- defined sources for data types, if omitted assume a single DS named "value" (optional)
18 sources = {
19 if_octets = { "tx", "rx" }
20 },
21
22 -- special options for single data lines
23 options = {
24 if_octets__tx = {
25 title = "Bytes (TX)",
26 total = true, -- report total amount of bytes
27 color = "00ff00" -- tx is green
28 },
29
30 if_octets__rx = {
31 title = "Bytes (RX)",
32 flip = true, -- flip rx line
33 total = true, -- report total amount of bytes
34 color = "0000ff" -- rx is blue
35 }
36 }
37 }
38 }
39
40 --
41 -- packet diagram
42 --
43 local packets = {
44 title = "%H: Netlink - Packets on %pi",
45 vlabel = "Packets/s", detail = true,
46
47 -- diagram data description
48 data = {
49 -- data type order
50 types = { "if_packets", "if_dropped", "if_errors" },
51
52 -- defined sources for data types
53 sources = {
54 if_packets = { "tx", "rx" },
55 if_dropped = { "tx", "rx" },
56 if_errors = { "tx", "rx" }
57 },
58
59 -- special options for single data lines
60 options = {
61 -- processed packets (tx DS)
62 if_packets__tx = {
63 weight = 2,
64 title = "Total (TX)",
65 overlay = true, -- don't summarize
66 total = true, -- report total amount of bytes
67 color = "00ff00" -- processed tx is green
68 },
69
70 -- processed packets (rx DS)
71 if_packets__rx = {
72 weight = 3,
73 title = "Total (RX)",
74 overlay = true, -- don't summarize
75 flip = true, -- flip rx line
76 total = true, -- report total amount of bytes
77 color = "0000ff" -- processed rx is blue
78 },
79
80 -- dropped packets (tx DS)
81 if_dropped__tx = {
82 weight = 1,
83 title = "Dropped (TX)",
84 overlay = true, -- don't summarize
85 total = true, -- report total amount of bytes
86 color = "660055" -- dropped tx is ... dunno ;)
87 },
88
89 -- dropped packets (rx DS)
90 if_dropped__rx = {
91 weight = 4,
92 title = "Dropped (RX)",
93 overlay = true, -- don't summarize
94 flip = true, -- flip rx line
95 total = true, -- report total amount of bytes
96 color = "ff00ff" -- dropped rx is violett
97 },
98
99 -- packet errors (tx DS)
100 if_errors__tx = {
101 weight = 0,
102 title = "Errors (TX)",
103 overlay = true, -- don't summarize
104 total = true, -- report total amount of packets
105 color = "ff5500" -- tx errors are orange
106 },
107
108 -- packet errors (rx DS)
109 if_errors__rx = {
110 weight = 5,
111 title = "Errors (RX)",
112 overlay = true, -- don't summarize
113 flip = true, -- flip rx line
114 total = true, -- report total amount of packets
115 color = "ff0000" -- rx errors are red
116 }
117 }
118 }
119 }
120
121 --
122 -- multicast diagram
123 --
124 local multicast = {
125 title = "%H: Netlink - Multicast on %pi",
126 vlabel = "Packets/s", detail = true,
127
128 -- diagram data description
129 data = {
130 -- data type order
131 types = { "if_multicast" },
132
133 -- special options for single data lines
134 options = {
135 -- multicast packets
136 if_multicast = {
137 title = "Packets",
138 total = true, -- report total amount of packets
139 color = "0000ff" -- multicast is blue
140 }
141 }
142 }
143 }
144
145 --
146 -- collision diagram
147 --
148 local collisions = {
149 title = "%H: Netlink - Collisions on %pi",
150 vlabel = "Collisions/s", detail = true,
151
152 -- diagram data description
153 data = {
154 -- data type order
155 types = { "if_collisions" },
156
157 -- special options for single data lines
158 options = {
159 -- collision rate
160 if_collisions = {
161 title = "Collisions",
162 total = true, -- report total amount of packets
163 color = "ff0000" -- collsions are red
164 }
165 }
166 }
167 }
168
169 --
170 -- error diagram
171 --
172 local errors = {
173 title = "%H: Netlink - Errors on %pi",
174 vlabel = "Errors/s", detail = true,
175
176 -- diagram data description
177 data = {
178 -- data type order
179 types = { "if_tx_errors", "if_rx_errors" },
180
181 -- data type instances
182 instances = {
183 if_tx_errors = { "aborted", "carrier", "fifo", "heartbeat", "window" },
184 if_rx_errors = { "length", "missed", "over", "crc", "fifo", "frame" }
185 },
186
187 -- special options for single data lines
188 options = {
189 if_tx_errors_aborted_value = { total = true, color = "ffff00", title = "Aborted (TX)" },
190 if_tx_errors_carrier_value = { total = true, color = "ffcc00", title = "Carrier (TX)" },
191 if_tx_errors_fifo_value = { total = true, color = "ff9900", title = "Fifo (TX)" },
192 if_tx_errors_heartbeat_value = { total = true, color = "ff6600", title = "Heartbeat (TX)" },
193 if_tx_errors_window_value = { total = true, color = "ff3300", title = "Window (TX)" },
194
195 if_rx_errors_length_value = { flip = true, total = true, color = "ff0000", title = "Length (RX)" },
196 if_rx_errors_missed_value = { flip = true, total = true, color = "ff0033", title = "Missed (RX)" },
197 if_rx_errors_over_value = { flip = true, total = true, color = "ff0066", title = "Over (RX)" },
198 if_rx_errors_crc_value = { flip = true, total = true, color = "ff0099", title = "CRC (RX)" },
199 if_rx_errors_fifo_value = { flip = true, total = true, color = "ff00cc", title = "Fifo (RX)" },
200 if_rx_errors_frame_value = { flip = true, total = true, color = "ff00ff", title = "Frame (RX)" }
201 }
202 }
203 }
204
205 return { traffic, packets, multicast, collisions, errors }
206 end