aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/ping.php
diff options
context:
space:
mode:
authorPim van den Berg2011-04-10 19:56:08 +0200
committerPim van den Berg2011-04-10 19:56:08 +0200
commit6bc103c0c6880673f207c87466f4fcac2645bd8c (patch)
tree829fa608416de0dea83b3c9c1689cb7077dfa943 /plugin/ping.php
parentplugin: add tail plugin (diff)
downloadapt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.zip
apt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.tar.gz
apt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.tar.bz2
apt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.tar.xz
plugin: deduplicate rrd_format code
Diffstat (limited to 'plugin/ping.php')
-rw-r--r--plugin/ping.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugin/ping.php b/plugin/ping.php
index 1ea53de..9780969 100644
--- a/plugin/ping.php
+++ b/plugin/ping.php
@@ -19,22 +19,21 @@ $obj->ds_names = array('ping' => 'Ping time',
19 'ping_droprate' => 'Ping droprate'); 19 'ping_droprate' => 'Ping droprate');
20$obj->width = $width; 20$obj->width = $width;
21$obj->heigth = $heigth; 21$obj->heigth = $heigth;
22$obj->rrd_format = '%5.1lf';
23
22switch($obj->args['type']) { 24switch($obj->args['type']) {
23 case 'ping': 25 case 'ping':
24 $obj->data_sources = array('ping'); 26 $obj->data_sources = array('ping');
25 $obj->rrd_title = 'Ping latency'; 27 $obj->rrd_title = 'Ping latency';
26 $obj->rrd_vertical = 'Milliseconds'; 28 $obj->rrd_vertical = 'Milliseconds';
27 $obj->rrd_format = '%5.1lf';
28 break; 29 break;
29 case 'ping_stddev': 30 case 'ping_stddev':
30 $obj->rrd_title = 'Ping stddev'; 31 $obj->rrd_title = 'Ping stddev';
31 $obj->rrd_vertical = ''; 32 $obj->rrd_vertical = '';
32 $obj->rrd_format = '%5.1lf';
33 break; 33 break;
34 case 'ping_droprate': 34 case 'ping_droprate':
35 $obj->rrd_title = 'Ping droprate'; 35 $obj->rrd_title = 'Ping droprate';
36 $obj->rrd_vertical = ''; 36 $obj->rrd_vertical = '';
37 $obj->rrd_format = '%5.1lf';
38 break; 37 break;
39} 38}
40 39