From d78f79a404db4610a9a92ca44e9258a02ee4a53c Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Mon, 21 Jan 2019 14:05:57 +0100 Subject: [PATCH] luci-app-statistics: fix whitespaces in rrdtool definitions Signed-off-by: Florian Eckert --- .../statistics/rrdtool/definitions/apcups.lua | 7 ++-- .../rrdtool/definitions/conntrack.lua | 1 + .../statistics/rrdtool/definitions/curl.lua | 1 + .../statistics/rrdtool/definitions/disk.lua | 1 + .../rrdtool/definitions/netlink.lua | 5 --- .../statistics/rrdtool/definitions/olsrd.lua | 14 +++---- .../statistics/rrdtool/definitions/ping.lua | 1 + .../rrdtool/definitions/processes.lua | 12 +++--- .../rrdtool/definitions/sensors.lua | 1 + .../rrdtool/definitions/splash_leases.lua | 41 +++++++++---------- .../rrdtool/definitions/tcpconns.lua | 1 + .../statistics/rrdtool/definitions/uptime.lua | 19 ++++----- 12 files changed, 51 insertions(+), 53 deletions(-) diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua index 9f7a51a86..37055f586 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua @@ -19,8 +19,7 @@ function rrdargs( graph, plugin, plugin_instance ) ups_inst[t] = graph.tree:data_instances( plugin, plugin_instance, t ) end - - -- Check if hash table or array is empty or nil-filled + -- Check if hash table or array is empty or nil-filled local function empty( t ) for _, v in pairs(t) do @@ -57,8 +56,8 @@ function rrdargs( graph, plugin, plugin_instance ) end - -- Graph definitions for APC UPS measurements MUST use only 'instances': - -- e.g. instances = { voltage = { "input", "output" } } + -- Graph definitions for APC UPS measurements MUST use only 'instances': + -- e.g. instances = { voltage = { "input", "output" } } local voltagesdc = { title = "%H: Voltages on APC UPS - Battery", diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua index fbc47731e..5212b736e 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua @@ -4,6 +4,7 @@ module("luci.statistics.rrdtool.definitions.conntrack",package.seeall) function rrdargs( graph, plugin, plugin_instance, dtype ) + return { title = "%H: Conntrack entries", vlabel = "Count", diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/curl.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/curl.lua index 89a65a6b5..2bbdfb08f 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/curl.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/curl.lua @@ -4,6 +4,7 @@ module("luci.statistics.rrdtool.definitions.curl", package.seeall) function rrdargs( graph, plugin, plugin_instance, dtype ) + return { title = "%H: cUrl Response Time for #%pi", y_min = "0", diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/disk.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/disk.lua index 8aabb7f64..b6f7d6d5f 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/disk.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/disk.lua @@ -4,6 +4,7 @@ module("luci.statistics.rrdtool.definitions.disk", package.seeall) function rrdargs( graph, plugin, plugin_instance, dtype ) + return { { title = "%H: Disk I/O operations on %pi", diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua index a612126ed..f48504853 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua @@ -37,7 +37,6 @@ function rrdargs( graph, plugin, plugin_instance ) } } - -- -- packet diagram -- @@ -119,7 +118,6 @@ function rrdargs( graph, plugin, plugin_instance ) } } - -- -- multicast diagram -- @@ -144,7 +142,6 @@ function rrdargs( graph, plugin, plugin_instance ) } } - -- -- collision diagram -- @@ -169,7 +166,6 @@ function rrdargs( graph, plugin, plugin_instance ) } } - -- -- error diagram -- @@ -206,6 +202,5 @@ function rrdargs( graph, plugin, plugin_instance ) } } - return { traffic, packets, multicast, collisions, errors } end diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/olsrd.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/olsrd.lua index a69469568..481557bb7 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/olsrd.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/olsrd.lua @@ -9,18 +9,18 @@ function rrdargs( graph, plugin, plugin_instance, dtype ) if plugin_instance == "routes" then g[#g+1] = { - -- diagram data description + -- diagram data description title = "%H: Total amount of OLSR routes", vlabel = "n", number_format = "%5.0lf", data = { - types = { "routes" }, + types = { "routes" }, options = { routes = { color = "ff0000", title = "Total number of routes" } } - } - } + } + } g[#g+1] = { title = "%H: Average route ETX", vlabel = "ETX", detail = true, @@ -80,7 +80,7 @@ function rrdargs( graph, plugin, plugin_instance, dtype ) number_format = "%5.2lf", detail = true, data = { types = { "signal_quality" }, - + instances = { signal_quality = { instances[i], instances[i+1] }, }, @@ -106,7 +106,7 @@ function rrdargs( graph, plugin, plugin_instance, dtype ) title= "%H: Total amount of OLSR links", vlabel = "n", number_format = "%5.0lf", data = { instances = { "" }, - types = { "links" }, + types = { "links" }, options = { links = { color = "0000ff", @@ -114,7 +114,7 @@ function rrdargs( graph, plugin, plugin_instance, dtype ) } } } - } + } g[#g+1] = { title= "%H: Average signal quality", vlabel = "n", 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 6ecdb5c8a..5b575bfff 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua @@ -4,6 +4,7 @@ module("luci.statistics.rrdtool.definitions.ping", package.seeall) function rrdargs( graph, plugin, plugin_instance, dtype ) + return { -- Ping roundtrip time { title = "%H: ICMP Round Trip Time", diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/processes.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/processes.lua index 62d054597..010ac1cd2 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/processes.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/processes.lua @@ -5,8 +5,8 @@ module("luci.statistics.rrdtool.definitions.processes", package.seeall) function rrdargs( graph, plugin, plugin_instance, dtype ) - if plugin_instance == "" then - return { + if plugin_instance == "" then + return { title = "%H: Processes", vlabel = "Processes/s", data = { @@ -26,9 +26,9 @@ function rrdargs( graph, plugin, plugin_instance, dtype ) ps_state_zombies = { color = "ff0000", title = "Zombies" } } } - } - else - return { + } + else + return { { title = "%H: CPU time used by %pi", vlabel = "Jiffies", @@ -113,5 +113,5 @@ function rrdargs( graph, plugin, plugin_instance, dtype ) } } } - end + end end diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua index f8bddb96e..b3119234a 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua @@ -4,6 +4,7 @@ module("luci.statistics.rrdtool.definitions.sensors", package.seeall) function rrdargs( graph, plugin, plugin_instance ) + return { { per_instance = true, diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/splash_leases.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/splash_leases.lua index 65fba5299..1a192ae6a 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/splash_leases.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/splash_leases.lua @@ -1,27 +1,26 @@ -- Copyright 2013 Freifunk Augsburg / Michael Wendland -- Licensed to the public under the Apache License 2.0. - module("luci.statistics.rrdtool.definitions.splash_leases", package.seeall) - + function rrdargs( graph, plugin, plugin_instance, dtype ) - - return { - title = "%H: Splash Leases", - vlabel = "Active Clients", - y_min = "0", - number_format = "%5.1lf", - data = { - sources = { - splash_leases = { "leased", "whitelisted", "blacklisted" } - }, - - options = { - splash_leases__leased = { color = "00CC00", title = "Leased", overlay = false }, - splash_leases__whitelisted = { color = "0000FF", title = "Whitelisted", overlay = false }, - splash_leases__blacklisted = { color = "FF0000", title = "Blacklisted", overlay = false } - } - } - } -end + return { + title = "%H: Splash Leases", + vlabel = "Active Clients", + y_min = "0", + number_format = "%5.1lf", + data = { + sources = { + splash_leases = { "leased", "whitelisted", "blacklisted" } + }, + + options = { + splash_leases__leased = { color = "00CC00", title = "Leased", overlay = false }, + splash_leases__whitelisted = { color = "0000FF", title = "Whitelisted", overlay = false }, + splash_leases__blacklisted = { color = "FF0000", title = "Blacklisted", overlay = false } + } + } + } + +end diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/tcpconns.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/tcpconns.lua index 50a9470de..7e7ed238f 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/tcpconns.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/tcpconns.lua @@ -4,6 +4,7 @@ module("luci.statistics.rrdtool.definitions.tcpconns", package.seeall) function rrdargs( graph, plugin, plugin_instance, dtype ) + return { title = "%H: TCP connections to port %pi", vlabel = "Connections/s", diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/uptime.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/uptime.lua index 077ec57e8..a50e78491 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/uptime.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/uptime.lua @@ -13,15 +13,14 @@ module("luci.statistics.rrdtool.definitions.uptime", package.seeall) function rrdargs( graph, plugin, plugin_instance, dtype ) - return { - title = "%H: Uptime", vlabel = "seconds", - number_format = "%5.0lf%s", data = { - types = { "uptime" }, - options = { - uptime = { title = "Uptime %di", noarea = true } - } - } - } - + return { + title = "%H: Uptime", vlabel = "seconds", + number_format = "%5.0lf%s", data = { + types = { "uptime" }, + options = { + uptime = { title = "Uptime %di", noarea = true } + } + } + } end -- 2.25.1