aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/apache.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/apache.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/apache.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugin/apache.php b/plugin/apache.php
index 95c12fa..71be4fe 100644
--- a/plugin/apache.php
+++ b/plugin/apache.php
@@ -19,14 +19,15 @@ switch ($obj->args['type']) {
19 case 'apache_bytes': 19 case 'apache_bytes':
20 $obj->data_sources = array('value'); 20 $obj->data_sources = array('value');
21 $obj->ds_names = array( 21 $obj->ds_names = array(
22 'value' => 'Bytes/s', 22 'value' => sprintf('%s/s', ucfirst($CONFIG['datasize'])),
23 ); 23 );
24 $obj->colors = array( 24 $obj->colors = array(
25 'value' => '0000ff', 25 'value' => '0000ff',
26 ); 26 );
27 $obj->rrd_title = sprintf('Webserver Traffic%s', 27 $obj->rrd_title = sprintf('Webserver Traffic%s',
28 !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : ''); 28 !empty($obj->args['pinstance']) ? ' ('.$obj->args['pinstance'].')' : '');
29 $obj->rrd_vertical = 'Bytes/s'; 29 $obj->rrd_vertical = sprintf('%s/s', ucfirst($CONFIG['datasize']));
30 $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1;
30 break; 31 break;
31 case 'apache_connections': 32 case 'apache_connections':
32 $obj->data_sources = array('value'); 33 $obj->data_sources = array('value');