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/postgresql.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugin/postgresql.php') diff --git a/plugin/postgresql.php b/plugin/postgresql.php index 1eadc8d..ed984a6 100644 --- a/plugin/postgresql.php +++ b/plugin/postgresql.php @@ -51,7 +51,8 @@ switch($obj->args['type']) { ); $obj->rrd_title = sprintf('PostgreSQL DB size (%s)', !empty($obj->args['pinstance']) ? $obj->args['pinstance'] : ''); - $obj->rrd_vertical = 'Bytes'; + $obj->rrd_vertical = ucfirst($CONFIG['datasize']); + $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; break; case 'pg_n_tup_c': $obj->order = array( -- cgit v1.1