aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/zfs_arc.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/zfs_arc.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 '')
-rw-r--r--plugin/zfs_arc.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugin/zfs_arc.php b/plugin/zfs_arc.php
index d40912d..1cc7e81 100644
--- a/plugin/zfs_arc.php
+++ b/plugin/zfs_arc.php
@@ -60,7 +60,8 @@ switch($obj->args['type']) {
60 'maxlimit', 60 'maxlimit',
61 ); 61 );
62 $obj->rrd_title = 'Arc size'; 62 $obj->rrd_title = 'Arc size';
63 $obj->rrd_vertical = 'bytes'; 63 $obj->rrd_vertical = ucfirst($CONFIG['datasize']);
64 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
64 break; 65 break;
65 case 'arc_l2_bytes': 66 case 'arc_l2_bytes':
66 $obj->data_sources = array( 67 $obj->data_sources = array(
@@ -76,20 +77,22 @@ switch($obj->args['type']) {
76 'read' => '0000ff', 77 'read' => '0000ff',
77 ); 78 );
78 $obj->rrd_title = 'Arc L2 bytes'; 79 $obj->rrd_title = 'Arc L2 bytes';
79 $obj->rrd_vertical = 'bytes'; 80 $obj->rrd_vertical = ucfirst($CONFIG['datasize']);
81 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
80 break; 82 break;
81 case 'arc_l2_size': 83 case 'arc_l2_size':
82 $obj->data_sources = array( 84 $obj->data_sources = array(
83 'value', 85 'value',
84 ); 86 );
85 $obj->ds_names = array( 87 $obj->ds_names = array(
86 'value' => 'Bytes', 88 'value' => ucfirst($CONFIG['datasize']),
87 ); 89 );
88 $obj->colors = array( 90 $obj->colors = array(
89 'value' => '0000ff', 91 'value' => '0000ff',
90 ); 92 );
91 $obj->rrd_title = 'Arc L2 size'; 93 $obj->rrd_title = 'Arc L2 size';
92 $obj->rrd_vertical = 'bytes'; 94 $obj->rrd_vertical = ucfirst($CONFIG['datasize']);
95 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
93 break; 96 break;
94 case 'arc_ratio': 97 case 'arc_ratio':
95 $obj->data_sources = array('value'); 98 $obj->data_sources = array('value');