From fd04134830d3111c137b47c7ba25a049ab597715 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Fri, 10 Aug 2012 18:56:30 +0200 Subject: introduce config option datasize to show graphs in bits or bytes Config setting $CONFIG['datasize'] can be set to bits or bytes to show graph data in bits or bytes. Inspired-by: Neptune Ning (Plan) --- plugin/apache.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugin/apache.php') diff --git a/plugin/apache.php b/plugin/apache.php index 95c12fa..71be4fe 100644 --- a/plugin/apache.php +++ b/plugin/apache.php @@ -19,14 +19,15 @@ switch ($obj->args['type']) { case 'apache_bytes': $obj->data_sources = array('value'); $obj->ds_names = array( - 'value' => 'Bytes/s', + 'value' => sprintf('%s/s', ucfirst($CONFIG['datasize'])), ); $obj->colors = array( 'value' => '0000ff', ); $obj->rrd_title = sprintf('Webserver Traffic%s', !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); - $obj->rrd_vertical = 'Bytes/s'; + $obj->rrd_vertical = sprintf('%s/s', ucfirst($CONFIG['datasize'])); + $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; break; case 'apache_connections': $obj->data_sources = array('value'); -- cgit v1.1