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/dns.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugin/dns.php') diff --git a/plugin/dns.php b/plugin/dns.php index 15143b5..d0784df 100644 --- a/plugin/dns.php +++ b/plugin/dns.php @@ -15,6 +15,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 'dns_octets': $obj->data_sources = array( @@ -31,19 +33,16 @@ switch($obj->args['type']) { ); $obj->rrd_title = 'DNS traffic'; $obj->rrd_vertical = 'Bit/s'; - $obj->rrd_format = '%5.1lf%s'; break; case 'dns_opcode': $obj->data_sources = array('value'); $obj->rrd_title = 'DNS Opcode Query'; $obj->rrd_vertical = 'Queries/s'; - $obj->rrd_format = '%5.1lf%s'; break; case 'dns_qtype': $obj->data_sources = array('value'); $obj->rrd_title = 'DNS QType'; $obj->rrd_vertical = 'Queries/s'; - $obj->rrd_format = '%5.1lf%s'; break; } -- cgit v1.1