335e976794d7bdb1c1cef99847ce611f7f730189
[openwrt-luci.git] /
1 /* Licensed to the public under the Apache License 2.0. */
2
3 'use strict';
4 'require baseclass';
5
6 return baseclass.extend({
7         title: _('Ping'),
8
9         rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
10                 var ping = {
11                         title: "%H: ICMP Round Trip Time",
12                         vlabel: "ms",
13                         number_format: "%5.1lf ms",
14                         data: {
15                                 sources: {
16                                         ping: [ "value" ]
17                                 },
18                                 options: {
19                                         ping__value: {
20                                                 noarea: true,
21                                                 overlay: true,
22                                                 title: "%di"
23                                         }
24                                 }
25                         }
26                 };
27
28                 var droprate = {
29                         title: "%H: ICMP Drop Rate",
30                         vlabel: "%",
31                         y_min: "0",
32                         y_max: "4",
33                         number_format: "%5.2lf %%",
34                         data: {
35                                 types: [ "ping_droprate" ],
36                                 options: {
37                                         ping_droprate: {
38                                                 noarea: true,
39                                                 overlay: true,
40                                                 title: "%di",
41                                                 transform_rpn: "100,*"
42                                         }
43                                 }
44                         }
45                 };
46
47                 var stddev = {
48                         title: "%H: ICMP Standard Deviation",
49                         vlabel: "ms",
50                         y_min: "0",
51                         y_max: "1",
52                         number_format: "%5.1lf ms",
53                         data: {
54                                 types: [ "ping_stddev" ],
55                                 options: {
56                                         ping_stddev: {
57                                                 noarea: true,
58                                                 overlay: true,
59                                                 title: "%di"
60                                         }
61                                 }
62                         }
63                 };
64
65                 return [ ping, droprate, stddev ];
66         }
67 });
git clone https://git.99rst.org/PROJECT