From cb252b2c03189446fb8a8413e1371c84bcb044dd Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Fri, 13 Sep 2019 14:01:36 +0200 Subject: luci-app-statistics: cleanup ping definitions Signed-off-by: Florian Eckert --- .../luasrc/statistics/rrdtool/definitions/ping.lua | 57 ++++++++++++++-------- 1 file changed, 38 insertions(+), 19 deletions(-) (limited to 'applications/luci-app-statistics/luasrc/statistics') diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua index e290af549a..6ad11985ec 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua @@ -9,25 +9,44 @@ end function rrdargs( graph, plugin, plugin_instance, dtype ) - return { - -- Ping roundtrip time - { title = "%H: ICMP Round Trip Time", - vlabel = "ms", - number_format = "%5.1lf ms", - data = { - sources = { ping = { "value" } }, - options = { ping__value = { - noarea = true, overlay = true, title = "%di" } } - } }, + local ping = { + title = "%H: ICMP Round Trip Time", + vlabel = "ms", + number_format = "%5.1lf ms", + data = { + sources = { + ping = { + "value" + } + }, + options = { + ping__value = { + noarea = true, + overlay = true, + title = "%di" + } + } + } + } - -- Ping droprate - { title = "%H: ICMP Drop Rate", - vlabel = "%", - number_format = "%5.2lf %%", - data = { - types = { "ping_droprate" }, - options = { ping_droprate = { - noarea = true, overlay = true, title = "%di", transform_rpn = "100,*" } } - } } + local droprate = { + title = "%H: ICMP Drop Rate", + vlabel = "%", + number_format = "%5.2lf %%", + data = { + types = { + "ping_droprate" + }, + options = { + ping_droprate = { + noarea = true, + overlay = true, + title = "%di", + transform_rpn = "100,*" + } + } + } } + + return { ping, droprate } end -- cgit v1.2.3