aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/disk.php
diff options
context:
space:
mode:
authorPim van den Berg2012-08-10 18:56:30 +0200
committerPim van den Berg2012-08-10 19:00:16 +0200
commitfd04134830d3111c137b47c7ba25a049ab597715 (patch)
treec2390f06640f2127ab3e987cd3bdaf1d639b3dc2 /plugin/disk.php
parenttype: add scale support to default/generic stacked types (diff)
downloadapt-panopticon_cgp-fd04134830d3111c137b47c7ba25a049ab597715.zip
apt-panopticon_cgp-fd04134830d3111c137b47c7ba25a049ab597715.tar.gz
apt-panopticon_cgp-fd04134830d3111c137b47c7ba25a049ab597715.tar.bz2
apt-panopticon_cgp-fd04134830d3111c137b47c7ba25a049ab597715.tar.xz
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) <frostyplanet@gmail.com>
Diffstat (limited to 'plugin/disk.php')
-rw-r--r--plugin/disk.php3
1 files changed, 2 insertions, 1 deletions
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']) {
33 break; 33 break;
34 case 'disk_octets': 34 case 'disk_octets':
35 $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['pinstance']); 35 $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['pinstance']);
36 $obj->rrd_vertical = 'Bytes per second'; 36 $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize']));
37 $obj->rrd_format = '%5.1lf%s'; 37 $obj->rrd_format = '%5.1lf%s';
38 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
38 break; 39 break;
39 case 'disk_ops': 40 case 'disk_ops':
40 $obj->rrd_title = sprintf('Disk Operations (%s)', $obj->args['pinstance']); 41 $obj->rrd_title = sprintf('Disk Operations (%s)', $obj->args['pinstance']);