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/libvirt.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 'plugin/libvirt.php')
-rw-r--r-- | plugin/libvirt.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugin/libvirt.php b/plugin/libvirt.php index 829c592..971b5a7 100644 --- a/plugin/libvirt.php +++ b/plugin/libvirt.php | |||
@@ -30,7 +30,8 @@ switch($obj->args['type']) { | |||
30 | 'write' => '00b000', | 30 | 'write' => '00b000', |
31 | ); | 31 | ); |
32 | $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['tinstance']); | 32 | $obj->rrd_title = sprintf('Disk Traffic (%s)', $obj->args['tinstance']); |
33 | $obj->rrd_vertical = 'Bytes per second'; | 33 | $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize'])); |
34 | $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; | ||
34 | $obj->rrd_format = '%5.1lf%s'; | 35 | $obj->rrd_format = '%5.1lf%s'; |
35 | break; | 36 | break; |
36 | case 'disk_ops': | 37 | case 'disk_ops': |
@@ -84,7 +85,8 @@ switch($obj->args['type']) { | |||
84 | 'tx' => '00b000', | 85 | 'tx' => '00b000', |
85 | ); | 86 | ); |
86 | $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args['tinstance']); | 87 | $obj->rrd_title = sprintf('Interface Traffic (%s)', $obj->args['tinstance']); |
87 | $obj->rrd_vertical = 'Bytes per second'; | 88 | $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize'])); |
89 | $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; | ||
88 | break; | 90 | break; |
89 | case 'if_packets': | 91 | case 'if_packets': |
90 | $obj->data_sources = array('rx', 'tx'); | 92 | $obj->data_sources = array('rx', 'tx'); |