Merge pull request #1818 from dibdot/lxc_fix
[project/luci.git] / applications / luci-app-statistics / luasrc / statistics / rrdtool / definitions / iwinfo.lua
1 -- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
3
4 module("luci.statistics.rrdtool.definitions.iwinfo", package.seeall)
5
6 function rrdargs( graph, plugin, plugin_instance )
7
8         --
9         -- signal/noise diagram
10         --
11         local snr = {
12                 title = "%H: Signal and noise on %pi",
13                 vlabel = "dBm",
14                 number_format = "%5.1lf dBm",
15                 data = {
16                         types = { "signal_noise", "signal_power" },
17                         options = {
18                                 signal_power = {
19                                         title  = "Signal",
20                                         overlay = true,
21                                         color   = "0000ff"
22                                 },
23                                 signal_noise = {
24                                         title   = "Noise",
25                                         overlay = true,
26                                         color   = "ff0000"
27                                 }
28                         }
29                 }
30         }
31
32
33         --
34         -- signal quality diagram
35         --
36         local quality = {
37                 title = "%H: Signal quality on %pi",
38                 vlabel = "Quality",
39                 number_format = "%3.0lf",
40                 data = {
41                         types = { "signal_quality" },
42                         options = {
43                                 signal_quality = {
44                                         title  = "Quality",
45                                         noarea = true,
46                                         color  = "0000ff"
47                                 }
48                         }
49                 }
50         }
51
52
53         --
54         -- phy rate diagram
55         --
56         local bitrate = {
57                 title = "%H: Average phy rate on %pi",
58                 vlabel = "MBit/s",
59                 number_format = "%5.1lf%sBit/s",
60                 data = {
61                         types = { "bitrate" },
62                         options = {
63                                 bitrate = {
64                                         title = "Rate",
65                                         color = "00ff00"
66                                 }
67                         }
68                 }
69         }
70
71         --
72         -- associated stations
73         --
74         local stations = {
75                 title = "%H: Associated stations on %pi",
76                 vlabel = "Stations",
77                 y_min = "0",
78                 alt_autoscale_max = true,
79                 number_format = "%3.0lf",
80                 data = {
81                         types = { "stations" },
82                         options = {
83                                 stations = {
84                                         title = "Stations",
85                                         color = "0000ff"
86                                 }
87                         }
88                 }
89         }
90
91         return { snr, quality, bitrate, stations }
92 end