diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-05-27 20:32:04 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-05-27 20:32:04 +0000 |
commit | 3f09d369d679d3e4413849cf67f757c647a66965 (patch) | |
tree | 117cb8ea6082cedfd07ef14d021ba7aa0d060776 /applications/luci-statistics/luasrc/statistics/rrdtool/definitions | |
parent | 6a0da42befb970b56f93c0bf109a9cb7475e8e0c (diff) |
* luci/statistics: implement flip, overlay and total options for diagram models, improved/fixed netlink and wireless models
Diffstat (limited to 'applications/luci-statistics/luasrc/statistics/rrdtool/definitions')
-rw-r--r-- | applications/luci-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua | 93 | ||||
-rw-r--r-- | applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua | 7 |
2 files changed, 59 insertions, 41 deletions
diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua index 3cee6abc0..3960b9c53 100644 --- a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua +++ b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua @@ -6,63 +6,71 @@ function rrdargs( graph, host, plugin, plugin_instance ) -- diagram names local dtypes_names = { + "Verkehr", "Pakete", + "Multicast-Pakete", "Paketkollisionen", "Paketfehler", - "Verkehr", "RX-Fehler", "TX-Fehler" } -- diagram units local dtypes_units = { + "Bytes/s", + "Pakete/s", "Pakete/s", "Kollisionen/s", "Fehler/s", -- (?) - "Bytes/s", "Fehler/s", "Fehler/s" } -- data source overrides local dtypes_sources = { - if_errors = { "rx", "tx" }, -- if_errors has rx and tx - if_octets = { "rx", "tx" } -- if_octets has rx and tx + if_errors = { "tx", "rx" }, -- if_errors has tx and rx + if_octets = { "tx", "rx" }, -- if_octets has tx and rx + if_packets = { "tx", "rx" }, -- if_packets has tx and rx + if_dropped = { "tx", "rx" }, -- if_dopped has tx and rx } -- diagram data types local dtypes_list = { - -- diagram 1: combined interface packet statistics + -- diagram 1: interface traffic statistics + { + if_octets = { "" } -- bytes/s + }, + + -- diagram 2: combined interface packet statistics { if_dropped = { "" }, -- packets/s - if_multicast = { "" }, -- packets/s if_packets = { "" } -- packets/s }, - -- diagram 2: interface collision statistics + -- diagram 3: multicast count { - if_collisions = { "" } -- collisions/s + if_multicast = { "" } -- packets/s }, - -- diagram 3: interface error statistics + -- diagram 4: interface collision statistics { - if_errors = { "" } -- errors/s (?) + if_collisions = { "" } -- collisions/s }, - -- diagram 4: interface traffic statistics + -- diagram 5: interface error statistics { - if_octets = { "" } -- bytes/s + if_errors = { "" } -- errors/s (?) }, - -- diagram 5: interface rx error statistics + -- diagram 6: interface rx error statistics { if_rx_errors = { -- errors/s "length", "missed", "over", "crc", "fifo", "frame" } }, - -- diagram 6: interface tx error statistics + -- diagram 7: interface tx error statistics { if_tx_errors = { -- errors/s "aborted", "carrier", "fifo", "heartbeat", "window" @@ -75,45 +83,51 @@ function rrdargs( graph, host, plugin, plugin_instance ) -- diagram 1 { - if_dropped = "ff0000", - if_multicast = "0000ff", - if_packets = "00ff00" + if_octets__tx_ = "00ff00", + if_octets__rx_ = "0000ff" }, -- diagram 2 { - if_collisions = "ff0000" + if_dropped__tx_ = "ff0000", + if_dropped__rx_ = "ff5500", + if_packets__tx_ = "00ff00", + if_packets__rx_ = "0000ff" }, -- diagram 3 { - if_errors__tx_ = "ff0000", - if_errors__rx_ = "ff5500" + if_multicast = "0000ff" }, -- diagram 4 { - if_octets__tx_ = "00ff00", - if_octets__rx_ = "0000ff" + if_collisions = "ff0000" }, -- diagram 5 { - length = "0000ff", - missed = "ff5500", - over = "ff0066", - crc = "ff0000", - fifo = "00ff00", - frame = "ffff00" + if_errors__tx_ = "ff0000", + if_errors__rx_ = "ff5500" }, -- diagram 6 { - aborted = "ff0000", - carrier = "ffff00", - fifo = "00ff00", - heartbeat = "0000ff", - window = "8800ff" + length = "0000ff", + missed = "ff5500", + over = "ff0066", + crc = "ff0000", + fifo = "00ff00", + frame = "ffff00" + }, + + -- diagram 7 + { + aborted = "ff0000", + carrier = "ffff00", + fifo = "00ff00", + heartbeat = "0000ff", + window = "8800ff" } } @@ -141,16 +155,19 @@ function rrdargs( graph, host, plugin, plugin_instance ) -- has override for i, ds in ipairs(dtypes_sources[dtype]) do table.insert( opts.sources, { - ds = ds, -- override - name = name .. " (" .. ds .. ")", - rrd = graph:mkrrdpath( host, plugin, plugin_instance, dtype, inst ) + ds = ds, -- override + name = name .. " (" .. ds .. ")", + rrd = graph:mkrrdpath( host, plugin, plugin_instance, dtype, inst ), + flip = ( ds == "rx" ), + total = ( ds == "rx" or ds == "tx" ) } ) end else -- no override, assume single "value" data source table.insert( opts.sources, { - name = name, - rrd = graph:mkrrdpath( host, plugin, plugin_instance, dtype, inst ) + name = name, + rrd = graph:mkrrdpath( host, plugin, plugin_instance, dtype, inst ), + total = ( name == "if_multicast" ) } ) end end diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua index e315ca521..708aee311 100644 --- a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua +++ b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/wireless.lua @@ -2,7 +2,7 @@ module("luci.statistics.rrdtool.definitions.wireless", package.seeall) function rrdargs( graph, host, plugin, plugin_instance ) - dtypes = { "signal_power", "signal_noise" } + dtypes = { "signal_noise", "signal_power" } opts = { } opts.sources = { } @@ -16,8 +16,9 @@ function rrdargs( graph, host, plugin, plugin_instance ) for i, dtype in ipairs(dtypes) do opts.sources[i] = { - name = dtype, - rrd = graph:mkrrdpath( host, plugin, plugin_instance, dtype ) + name = dtype, + rrd = graph:mkrrdpath( host, plugin, plugin_instance, dtype ), + overlay = true -- don't summarize values } end |