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/mysql.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'plugin/mysql.php') diff --git a/plugin/mysql.php b/plugin/mysql.php index c73c37a..aac9e88 100644 --- a/plugin/mysql.php +++ b/plugin/mysql.php @@ -9,13 +9,13 @@ 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 'mysql_commands': $obj->rrd_title = sprintf('MySQL commands (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Issues/s'; - $obj->rrd_format = '%5.1lf%s'; break; case 'mysql_handler': $obj->colors = array( @@ -33,7 +33,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('MySQL handler (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Invocations'; - $obj->rrd_format = '%5.1lf%s'; break; case 'mysql_locks': $obj->colors = array( @@ -42,7 +41,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('MySQL locks (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'locks'; - $obj->rrd_format = '%5.1lf%s'; break; case 'mysql_octets': $obj->data_sources = array('rx', 'tx'); @@ -56,7 +54,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('MySQL traffic (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Bits per second'; - $obj->rrd_format = '%5.1lf%s'; break; case 'mysql_qcache': $obj->data_sources = array('not_cached', 'inserts', 'hits', 'lowmem_prunes', 'queries_in_cache'); @@ -76,7 +73,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('MySQL query cache (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Queries/s'; - $obj->rrd_format = '%5.1lf%s'; break; case 'mysql_threads': $obj->data_sources = array('cached', 'connected', 'running', 'created'); @@ -94,7 +90,6 @@ switch($obj->args['type']) ); $obj->rrd_title = sprintf('MySQL threads (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Threads'; - $obj->rrd_format = '%5.1lf%s'; break; } -- cgit v1.1