summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-statistics/luasrc/statistics/rrdtool
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-statistics/luasrc/statistics/rrdtool')
-rw-r--r--applications/luci-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua102
-rw-r--r--applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua78
2 files changed, 102 insertions, 78 deletions
diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua
new file mode 100644
index 0000000000..54c869f7f0
--- /dev/null
+++ b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua
@@ -0,0 +1,102 @@
+--[[
+
+Luci statistics - wireless plugin diagram definition
+(c) 2011 Jo-Philipp Wich <xm@subsignal.org>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+module("luci.statistics.rrdtool.definitions.iwinfo", package.seeall)
+
+function rrdargs( graph, host, 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
diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua
deleted file mode 100644
index 7daddab67e..0000000000
--- a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua
+++ /dev/null
@@ -1,78 +0,0 @@
---[[
-
-Luci statistics - wireless plugin diagram definition
-(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
-]]--
-
-module("luci.statistics.rrdtool.definitions.wireless", package.seeall)
-
-function rrdargs( graph, host, plugin, plugin_instance )
-
- --
- -- signal/noise diagram
- --
- local snr = {
-
- -- draw this diagram for each data instance
- per_instance = true,
-
- -- diagram data description
- title = "%H: Signal to Noise Ratio on %pi",
- vlabel = "dBm",
- data = {
- types = { "signal_noise", "signal_power" },
-
- -- special options for single data lines
- options = {
- signal_power = {
- overlay = true, -- don't summarize
- color = "0000ff", -- power is blue
- title = "Signal",
- },
-
- signal_noise = {
- overlay = true, -- don't summarize
- color = "ff0000", -- noise is red
- title = "Noise",
- }
- }
- }
- }
-
-
- --
- -- signal quality diagram
- --
- local quality = {
-
- -- draw this diagram for each data instance
- per_instance = true,
- title = "%H: Signal Quality on %pi",
- vlabel = "n",
-
- -- diagram data description
- data = {
- types = { "signal_quality" },
-
- -- special options for single data lines
- options = {
- signal_quality = {
- noarea = true, -- don't draw area
- color = "0000ff", -- quality is blue
- title = "Signal Quality"
- }
- }
- }
- }
-
- return { snr, quality }
-end