27624828c29d6187dff0c005802c988b9dc54211
[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                         number_format: "%5.2lf %%",
32                         data: {
33                                 types: [ "ping_droprate" ],
34                                 options: {
35                                         ping_droprate: {
36                                                 noarea: true,
37                                                 overlay: true,
38                                                 title: "%di",
39                                                 transform_rpn: "100,*"
40                                         }
41                                 }
42                         }
43                 };
44
45                 var stddev = {
46                         title: "%H: ICMP Standard Deviation",
47                         vlabel: "ms",
48                         number_format: "%5.1lf ms",
49                         data: {
50                                 types: [ "ping_stddev" ],
51                                 options: {
52                                         ping_stddev: {
53                                                 noarea: true,
54                                                 overlay: true,
55                                                 title: "%di"
56                                         }
57                                 }
58                         }
59                 };
60
61                 return [ ping, droprate, stddev ];
62         }
63 });
git clone https://git.99rst.org/PROJECT