From: Florian Eckert Date: Fri, 13 Sep 2019 12:01:36 +0000 (+0200) Subject: luci-app-statistics: cleanup ping definitions X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cb252b2c03189446fb8a8413e1371c84bcb044dd;p=oweals%2Fluci.git luci-app-statistics: cleanup ping definitions Signed-off-by: Florian Eckert --- 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 e290af549..6ad11985e 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