aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/ntpd.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/ntpd.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/ntpd.php')
-rw-r--r--plugin/ntpd.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugin/ntpd.php b/plugin/ntpd.php
index c85ce8c..18187a9 100644
--- a/plugin/ntpd.php
+++ b/plugin/ntpd.php
@@ -19,30 +19,28 @@ $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%s';
23
22switch($obj->args['type']) { 24switch($obj->args['type']) {
23 case 'delay': 25 case 'delay':
24 $obj->data_sources = array('seconds'); 26 $obj->data_sources = array('seconds');
25 $obj->rrd_title = sprintf('Delay'); 27 $obj->rrd_title = sprintf('Delay');
26 $obj->rrd_vertical = 'Seconds'; 28 $obj->rrd_vertical = 'Seconds';
27 $obj->rrd_format = '%5.1lf%s';
28 break; 29 break;
29 case 'frequency_offset': 30 case 'frequency_offset':
30 $obj->data_sources = array('ppm'); 31 $obj->data_sources = array('ppm');
31 $obj->rrd_title = 'Frequency offset'; 32 $obj->rrd_title = 'Frequency offset';
32 $obj->rrd_vertical = 'ppm'; 33 $obj->rrd_vertical = 'ppm';
33 $obj->rrd_format = '%5.1lf%s';
34 break; 34 break;
35 case 'time_dispersion': 35 case 'time_dispersion':
36 $obj->data_sources = array('seconds'); 36 $obj->data_sources = array('seconds');
37 $obj->rrd_title = 'Time dispersion'; 37 $obj->rrd_title = 'Time dispersion';
38 $obj->rrd_vertical = 'Seconds'; 38 $obj->rrd_vertical = 'Seconds';
39 $obj->rrd_format = '%5.1lf%s';
40 break; 39 break;
41 case 'time_offset': 40 case 'time_offset':
42 $obj->data_sources = array('seconds'); 41 $obj->data_sources = array('seconds');
43 $obj->rrd_title = 'Time offset'; 42 $obj->rrd_title = 'Time offset';
44 $obj->rrd_vertical = 'Seconds'; 43 $obj->rrd_vertical = 'Seconds';
45 $obj->rrd_format = '%5.1lf%s';
46 break; 44 break;
47} 45}
48 46