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/memcached.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugin/memcached.php') diff --git a/plugin/memcached.php b/plugin/memcached.php index e011c9e..accf6b3 100644 --- a/plugin/memcached.php +++ b/plugin/memcached.php @@ -37,7 +37,8 @@ switch(GET('t')) { 'free' => '0000ff', ); $obj->rrd_title = 'Memcached Memory Usage'; - $obj->rrd_vertical = 'bytes'; + $obj->rrd_vertical = ucfirst($CONFIG['datasize']); + $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; break; # memcached_command-(flush|get|set).rrd @@ -104,7 +105,8 @@ switch(GET('t')) { 'tx' => '00b000', ); $obj->rrd_title = 'Memcached Network Traffic'; - $obj->rrd_vertical = 'Bytes'; + $obj->rrd_vertical = ucfirst($CONFIG['datasize']); + $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; break; # memcached_ops-(evictions|hits|misses).rrd case 'memcached_ops': -- cgit v1.1