aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/processes.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/processes.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/processes.php')
-rw-r--r--plugin/processes.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/plugin/processes.php b/plugin/processes.php
index dca00b7..c66d3fb 100644
--- a/plugin/processes.php
+++ b/plugin/processes.php
@@ -63,7 +63,8 @@ switch($obj->args['type'])
63 'value' => '0000ff', 63 'value' => '0000ff',
64 ); 64 );
65 $obj->rrd_title = sprintf('Text Resident Set (%s)', $obj->args['pinstance']); 65 $obj->rrd_title = sprintf('Text Resident Set (%s)', $obj->args['pinstance']);
66 $obj->rrd_vertical = 'Bytes'; 66 $obj->rrd_vertical = ucfirst($CONFIG['datasize']);
67 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
67 break; 68 break;
68 69
69 case 'ps_count': 70 case 'ps_count':
@@ -105,7 +106,8 @@ switch($obj->args['type'])
105 'write' => '00b000', 106 'write' => '00b000',
106 ); 107 );
107 $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['pinstance']); 108 $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['pinstance']);
108 $obj->rrd_vertical = 'Bytes per second'; 109 $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize']));
110 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
109 break; 111 break;
110 112
111 case 'ps_disk_ops': 113 case 'ps_disk_ops':
@@ -130,7 +132,8 @@ switch($obj->args['type'])
130 'value' => '0000ff', 132 'value' => '0000ff',
131 ); 133 );
132 $obj->rrd_title = sprintf('Data Resident Set (%s)', $obj->args['pinstance']); 134 $obj->rrd_title = sprintf('Data Resident Set (%s)', $obj->args['pinstance']);
133 $obj->rrd_vertical = 'Bytes'; 135 $obj->rrd_vertical = ucfirst($CONFIG['datasize']);
136 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
134 break; 137 break;
135 138
136 case 'ps_pagefaults': 139 case 'ps_pagefaults':
@@ -155,7 +158,8 @@ switch($obj->args['type'])
155 'value' => '0000ff', 158 'value' => '0000ff',
156 ); 159 );
157 $obj->rrd_title = sprintf('Resident Segment Size (%s)', $obj->args['pinstance']); 160 $obj->rrd_title = sprintf('Resident Segment Size (%s)', $obj->args['pinstance']);
158 $obj->rrd_vertical = 'Bytes'; 161 $obj->rrd_vertical = ucfirst($CONFIG['datasize']);
162 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
159 break; 163 break;
160 164
161 case 'ps_stacksize': 165 case 'ps_stacksize':
@@ -166,7 +170,8 @@ switch($obj->args['type'])
166 'value' => '0000ff', 170 'value' => '0000ff',
167 ); 171 );
168 $obj->rrd_title = sprintf('Stacksize (%s)', $obj->args['pinstance']); 172 $obj->rrd_title = sprintf('Stacksize (%s)', $obj->args['pinstance']);
169 $obj->rrd_vertical = 'Bytes'; 173 $obj->rrd_vertical = ucfirst($CONFIG['datasize']);
174 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
170 break; 175 break;
171 176
172 case 'ps_vm': 177 case 'ps_vm':
@@ -177,7 +182,8 @@ switch($obj->args['type'])
177 'value' => '0000ff', 182 'value' => '0000ff',
178 ); 183 );
179 $obj->rrd_title = sprintf('Virtual Memory (%s)', $obj->args['pinstance']); 184 $obj->rrd_title = sprintf('Virtual Memory (%s)', $obj->args['pinstance']);
180 $obj->rrd_vertical = 'Bytes'; 185 $obj->rrd_vertical = ucfirst($CONFIG['datasize']);
186 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
181 break; 187 break;
182 188
183} 189}