aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/vmem.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/vmem.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 '')
-rw-r--r--plugin/vmem.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugin/vmem.php b/plugin/vmem.php
index ea541fc..2fae536 100644
--- a/plugin/vmem.php
+++ b/plugin/vmem.php
@@ -16,6 +16,8 @@ require_once 'inc/collectd.inc.php';
16$obj = new Type_GenericStacked($CONFIG); 16$obj = new Type_GenericStacked($CONFIG);
17$obj->width = $width; 17$obj->width = $width;
18$obj->heigth = $heigth; 18$obj->heigth = $heigth;
19$obj->rrd_format = '%5.1lf%s';
20
19switch($obj->args['type']) { 21switch($obj->args['type']) {
20 case 'vmpage_faults': 22 case 'vmpage_faults':
21 $obj->data_sources = array('minflt', 'majflt'); 23 $obj->data_sources = array('minflt', 'majflt');
@@ -25,7 +27,6 @@ switch($obj->args['type']) {
25 'majflt' => 'Major'); 27 'majflt' => 'Major');
26 $obj->rrd_title = 'Page faults'; 28 $obj->rrd_title = 'Page faults';
27 $obj->rrd_vertical = ''; 29 $obj->rrd_vertical = '';
28 $obj->rrd_format = '%5.1lf%s';
29 break; 30 break;
30 case 'vmpage_io': 31 case 'vmpage_io':
31 $obj->data_sources = array('in', 'out'); 32 $obj->data_sources = array('in', 'out');
@@ -39,7 +40,6 @@ switch($obj->args['type']) {
39 'swap-out' => 'ffff00'); 40 'swap-out' => 'ffff00');
40 $obj->rrd_title = 'Page IO'; 41 $obj->rrd_title = 'Page IO';
41 $obj->rrd_vertical = ''; 42 $obj->rrd_vertical = '';
42 $obj->rrd_format = '%5.1lf%s';
43 break; 43 break;
44 case 'vmpage_number': 44 case 'vmpage_number':
45 $obj->data_sources = array('value'); 45 $obj->data_sources = array('value');
@@ -55,7 +55,6 @@ switch($obj->args['type']) {
55 'writeback', 'writeback_temp'); 55 'writeback', 'writeback_temp');
56 $obj->rrd_title = 'Pages'; 56 $obj->rrd_title = 'Pages';
57 $obj->rrd_vertical = ''; 57 $obj->rrd_vertical = '';
58 $obj->rrd_format = '%5.1lf%s';
59 break; 58 break;
60} 59}
61 60