diff options
author | Pim van den Berg | 2012-08-10 18:56:30 +0200 |
---|---|---|
committer | Pim van den Berg | 2012-08-10 19:00:16 +0200 |
commit | fd04134830d3111c137b47c7ba25a049ab597715 (patch) | |
tree | c2390f06640f2127ab3e987cd3bdaf1d639b3dc2 /plugin/apache.php | |
parent | type: add scale support to default/generic stacked types (diff) | |
download | apt-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.php | 5 |
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'); |