luci-app-olsr: handle empty result for non-status tables
[oweals/luci.git] / applications / luci-app-statistics / luasrc / statistics / rrdtool / definitions / ping.lua
1 -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
3
4 module("luci.statistics.rrdtool.definitions.ping", package.seeall)
5
6 function item()
7         return luci.i18n.translate("Ping")
8 end
9
10 function rrdargs( graph, plugin, plugin_instance, dtype )
11
12         return {
13                 -- Ping roundtrip time
14                 { title = "%H: ICMP Round Trip Time",
15                   vlabel = "ms",
16                   number_format = "%5.1lf ms",
17                   data = {
18                         sources = { ping = { "value" } },
19                         options = { ping__value = {
20                                 noarea = true, overlay = true, title = "%di" } }
21                 } },
22
23                 -- Ping droprate
24                 { title = "%H: ICMP Drop Rate",
25                   vlabel = "%",
26                   number_format = "%5.2lf %%",
27                   data = {
28                         types   = { "ping_droprate" },
29                         options = { ping_droprate = {
30                                 noarea = true, overlay = true, title = "%di" } }
31                 } }
32         }
33 end