0c6eed993615c6fbc3f592dd8fddee24b634dbd7
[project/luci.git] / applications / luci-app-statistics / luasrc / statistics / rrdtool / definitions / iwinfo.lua
1 --[[
2
3 Luci statistics - wireless plugin diagram definition
4 (c) 2011 Jo-Philipp Wich <xm@subsignal.org>
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.iwinfo", package.seeall)
17
18 function rrdargs( graph, plugin, plugin_instance )
19
20         --
21         -- signal/noise diagram
22         --
23         local snr = {
24                 title = "%H: Signal and noise on %pi",
25                 vlabel = "dBm",
26                 number_format = "%5.1lf dBm",
27                 data = {
28                         types = { "signal_noise", "signal_power" },
29                         options = {
30                                 signal_power = {
31                                         title  = "Signal",
32                                         overlay = true,
33                                         color   = "0000ff"
34                                 },
35                                 signal_noise = {
36                                         title   = "Noise",
37                                         overlay = true,
38                                         color   = "ff0000"
39                                 }
40                         }
41                 }
42         }
43
44
45         --
46         -- signal quality diagram
47         --
48         local quality = {
49                 title = "%H: Signal quality on %pi",
50                 vlabel = "Quality",
51                 number_format = "%3.0lf",
52                 data = {
53                         types = { "signal_quality" },
54                         options = {
55                                 signal_quality = {
56                                         title  = "Quality",
57                                         noarea = true,
58                                         color  = "0000ff"
59                                 }
60                         }
61                 }
62         }
63
64
65         --
66         -- phy rate diagram
67         --
68         local bitrate = {
69                 title = "%H: Average phy rate on %pi",
70                 vlabel = "MBit/s",
71                 number_format = "%5.1lf%sBit/s",
72                 data = {
73                         types = { "bitrate" },
74                         options = {
75                                 bitrate = {
76                                         title = "Rate",
77                                         color = "00ff00"
78                                 }
79                         }
80                 }
81         }
82
83         --
84         -- associated stations
85         --
86         local stations = {
87                 title = "%H: Associated stations on %pi",
88                 vlabel = "Stations",
89                 number_format = "%3.0lf",
90                 data = {
91                         types = { "stations" },
92                         options = {
93                                 stations = {
94                                         title = "Stations",
95                                         color = "0000ff"
96                                 }
97                         }
98                 }
99         }
100
101         return { snr, quality, bitrate, stations }
102 end