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/disk.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugin/disk.php') diff --git a/plugin/disk.php b/plugin/disk.php index e3a5f3d..a776abd 100644 --- a/plugin/disk.php +++ b/plugin/disk.php @@ -33,8 +33,9 @@ switch($obj->args['type']) { break; case 'disk_octets': $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['pinstance']); - $obj->rrd_vertical = 'Bytes per second'; + $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize'])); $obj->rrd_format = '%5.1lf%s'; + $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; break; case 'disk_ops': $obj->rrd_title = sprintf('Disk Operations (%s)', $obj->args['pinstance']); -- cgit v1.1