From 6bc103c0c6880673f207c87466f4fcac2645bd8c Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sun, 10 Apr 2011 19:56:08 +0200 Subject: plugin: deduplicate rrd_format code --- plugin/vmem.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugin/vmem.php') 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'; $obj = new Type_GenericStacked($CONFIG); $obj->width = $width; $obj->heigth = $heigth; +$obj->rrd_format = '%5.1lf%s'; + switch($obj->args['type']) { case 'vmpage_faults': $obj->data_sources = array('minflt', 'majflt'); @@ -25,7 +27,6 @@ switch($obj->args['type']) { 'majflt' => 'Major'); $obj->rrd_title = 'Page faults'; $obj->rrd_vertical = ''; - $obj->rrd_format = '%5.1lf%s'; break; case 'vmpage_io': $obj->data_sources = array('in', 'out'); @@ -39,7 +40,6 @@ switch($obj->args['type']) { 'swap-out' => 'ffff00'); $obj->rrd_title = 'Page IO'; $obj->rrd_vertical = ''; - $obj->rrd_format = '%5.1lf%s'; break; case 'vmpage_number': $obj->data_sources = array('value'); @@ -55,7 +55,6 @@ switch($obj->args['type']) { 'writeback', 'writeback_temp'); $obj->rrd_title = 'Pages'; $obj->rrd_vertical = ''; - $obj->rrd_format = '%5.1lf%s'; break; } -- cgit v1.1