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/processes.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'plugin/processes.php') diff --git a/plugin/processes.php b/plugin/processes.php index 466e1e3..dca00b7 100644 --- a/plugin/processes.php +++ b/plugin/processes.php @@ -18,6 +18,7 @@ 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']) { @@ -41,7 +42,6 @@ switch($obj->args['type']) ); $obj->rrd_title = 'Processes'; $obj->rrd_vertical = 'Processes'; - $obj->rrd_format = '%5.1lf%s'; break; case 'fork_rate': @@ -53,7 +53,6 @@ switch($obj->args['type']) ); $obj->rrd_title = 'Fork rate'; $obj->rrd_vertical = 'forks/s'; - $obj->rrd_format = '%5.1lf%s'; break; case 'ps_code': @@ -65,7 +64,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('Text Resident Set (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Bytes'; - $obj->rrd_format = '%5.1lf%s'; break; case 'ps_count': @@ -80,7 +78,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('Number of Processes/Threads (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Amount'; - $obj->rrd_format = '%5.1lf%s'; break; case 'ps_cputime': @@ -95,7 +92,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('CPU time (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'CPU time [s]'; - $obj->rrd_format = '%5.1lf%s'; break; case 'ps_disk_octets': @@ -110,7 +106,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Bytes per second'; - $obj->rrd_format = '%5.1lf%s'; break; case 'ps_disk_ops': @@ -125,7 +120,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('Disk Operations (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Ops per second'; - $obj->rrd_format = '%5.1lf%s'; break; case 'ps_data': @@ -137,7 +131,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('Data Resident Set (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Bytes'; - $obj->rrd_format = '%5.1lf%s'; break; case 'ps_pagefaults': @@ -152,7 +145,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('PageFaults (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Pagefaults'; - $obj->rrd_format = '%5.1lf%s'; break; case 'ps_rss': @@ -164,7 +156,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('Resident Segment Size (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Bytes'; - $obj->rrd_format = '%5.1lf%s'; break; case 'ps_stacksize': @@ -176,7 +167,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('Stacksize (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Bytes'; - $obj->rrd_format = '%5.1lf%s'; break; case 'ps_vm': @@ -188,7 +178,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('Virtual Memory (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Bytes'; - $obj->rrd_format = '%5.1lf%s'; break; } -- cgit v1.1