summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua
blob: 3ca3381ec4c4ce86b4cb50b73ba4aa15023cca08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
-- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.

module("luci.statistics.rrdtool.definitions.iwinfo", package.seeall)

function rrdargs( graph, plugin, plugin_instance )

	--
	-- signal/noise diagram
	--
	local snr = {
		title = "%H: Signal and noise on %pi",
		vlabel = "dBm",
		number_format = "%5.1lf dBm",
		data = {
			types = { "signal_noise", "signal_power" },
			options = {
				signal_power = {
					title  = "Signal",
					overlay = true,
					color   = "0000ff"
				},
				signal_noise = {
					title   = "Noise",
					overlay = true,
					color   = "ff0000"
				}
			}
		}
	}


	--
	-- signal quality diagram
	--
	local quality = {
		title = "%H: Signal quality on %pi",
		vlabel = "Quality",
		number_format = "%3.0lf",
		data = {
			types = { "signal_quality" },
			options = {
				signal_quality = {
					title  = "Quality",
					noarea = true,
					color  = "0000ff"
				}
			}
		}
	}


	--
	-- phy rate diagram
	--
	local bitrate = {
		title = "%H: Average phy rate on %pi",
		vlabel = "MBit/s",
		number_format = "%5.1lf%sBit/s",
		data = {
			types = { "bitrate" },
			options = {
				bitrate = {
					title = "Rate",
					color = "00ff00"
				}
			}
		}
	}

	--
	-- associated stations
	--
	local stations = {
		title = "%H: Associated stations on %pi",
		vlabel = "Stations",
		number_format = "%3.0lf",
		data = {
			types = { "stations" },
			options = {
				stations = {
					title = "Stations",
					color = "0000ff"
				}
			}
		}
	}

	return { snr, quality, bitrate, stations }
end