5707f3aba8cf5e71116de018a8f78a02464bc105
[project/luci.git] / applications / luci-statistics / luasrc / statistics / rrdtool / definitions / ping.lua
1 --[[
2
3 Luci statistics - ping plugin diagram definition
4 (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id: ping.lua 6810 2011-01-29 03:33:48Z jow $
13
14 ]]--
15
16 module("luci.statistics.rrdtool.definitions.ping", package.seeall)
17
18 function rrdargs( graph, plugin, plugin_instance, dtype )
19         return {
20                 -- Ping roundtrip time
21                 { title = "%H: ICMP Round Trip Time", vlabel = "ms",
22                   number_format = "%5.1lf ms", data = {
23                         sources = { ping = { "ping" } },
24                         options = { ping__ping = { noarea = true, title = "%di" } }
25                 } },
26
27                 -- Ping droprate
28                 { title = "%H: ICMP Drop Rate", vlabel = "%",
29                   number_format = "%5.2lf %%", data = {
30                         types   = { "ping_droprate" },
31                         options = { ping_droprate = { title = "%di" } }
32                 } },
33
34                 -- Ping standard deviation
35                 { title = "%H: ICMP Standard Deviation", vlabel = "ms",
36                   number_format = "%5.2lf ms", data = {
37                         types   = { "ping_stddev" },
38                         options = { ping_stddev = { title = "%di" } }
39                 } },
40         }
41 end