summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-05-28 19:37:20 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-05-28 19:37:20 +0000
commit38844ccb3107cd84488ae1cd67fec8e7de833eb4 (patch)
treeec4a59fc80ea237e11a0eef517133e8388f9b437
parentbb5ecfde728c8f2e503fc28780aada78301ba6e4 (diff)
* luci/statistics: added diagram model for interface plugin
-rw-r--r--applications/luci-statistics/luasrc/statistics/rrdtool/definitions/interface.lua104
1 files changed, 104 insertions, 0 deletions
diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/interface.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/interface.lua
new file mode 100644
index 0000000000..1b61ad68ec
--- /dev/null
+++ b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/interface.lua
@@ -0,0 +1,104 @@
+module("luci.statistics.rrdtool.definitions.interface", package.seeall)
+
+function rrdargs( graph, host, plugin, plugin_instance )
+
+ --
+ -- traffic diagram
+ --
+ local traffic = {
+
+ -- diagram title
+ title = "Verkehr",
+
+ -- vertical label
+ vlabel = "Bytes/s",
+
+ -- draw this diagram for each data instance
+ per_instance = true,
+
+ -- diagram data description
+ data = {
+ -- defined sources for data types, if ommitted assume a single DS named "value" (optional)
+ sources = {
+ if_octets = { "tx", "rx" }
+ },
+
+ -- special options for single data lines
+ options = {
+ if_octets__tx = {
+ total = true, -- report total amount of bytes
+ color = "00ff00" -- tx is green
+ },
+
+ if_octets__rx = {
+ flip = true, -- flip rx line
+ total = true, -- report total amount of bytes
+ color = "0000ff" -- rx is blue
+ }
+ }
+ }
+ }
+
+
+ --
+ -- packet diagram
+ --
+ local packets = {
+
+ -- diagram title
+ title = "Pakete",
+
+ -- vertical label
+ vlabel = "Pakete/s",
+
+ -- draw this diagram for each data instance
+ per_instance = true,
+
+ -- diagram data description
+ data = {
+ -- data type order
+ types = { "if_packets", "if_errors" },
+
+ -- defined sources for data types
+ sources = {
+ if_packets = { "tx", "rx" },
+ if_errors = { "tx", "rx" }
+ },
+
+ -- special options for single data lines
+ options = {
+ -- processed packets (tx DS)
+ if_packets__tx = {
+ overlay = true, -- don't summarize
+ total = true, -- report total amount of bytes
+ color = "00ff00" -- processed tx is green
+ },
+
+ -- processed packets (rx DS)
+ if_packets__rx = {
+ overlay = true, -- don't summarize
+ flip = true, -- flip rx line
+ total = true, -- report total amount of bytes
+ color = "0000ff" -- processed rx is blue
+ },
+
+ -- packet errors (tx DS)
+ if_errors__tx = {
+ overlay = true, -- don't summarize
+ total = true, -- report total amount of packets
+ color = "ff5500" -- tx errors are orange
+ },
+
+ -- packet errors (rx DS)
+ if_errors__rx = {
+ overlay = true, -- don't summarize
+ flip = true, -- flip rx line
+ total = true, -- report total amount of packets
+ color = "ff0000" -- rx errors are red
+ }
+ }
+ }
+ }
+
+ return { traffic, packets }
+end