From 786f0e715dc6fda1b4dc72e7033f280adde24283 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 5 Jul 2014 14:14:29 +0200 Subject: type/default: optionally draw min/max spikes in a lighter color in graphs Closes #73 --- conf/config.php | 3 +++ type/Base.class.php | 2 ++ type/Default.class.php | 7 +++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/conf/config.php b/conf/config.php index e40cc9f..30eaaf9 100644 --- a/conf/config.php +++ b/conf/config.php @@ -62,6 +62,9 @@ $CONFIG['percentile'] = false; # create smooth graphs (rrdtool -E) $CONFIG['graph_smooth'] = false; +# draw min/max spikes in a lighter color in graphs with type default +$CONFIG['graph_minmax'] = false; + # browser cache time for the graphs (in seconds) $CONFIG['cache'] = 90; diff --git a/type/Base.class.php b/type/Base.class.php index 34e182f..5af4c29 100644 --- a/type/Base.class.php +++ b/type/Base.class.php @@ -24,6 +24,7 @@ class Type_Base { var $negative_io; var $percentile = false; var $graph_smooth; + var $graph_minmax; var $files; var $tinstances; @@ -57,6 +58,7 @@ class Type_Base { $this->graph_type = $config['graph_type']; $this->negative_io = $config['negative_io']; $this->graph_smooth = $config['graph_smooth']; + $this->graph_minmax = $config['graph_minmax']; $this->flush_socket = $config['socket']; $this->flush_type = $config['flush_type']; } diff --git a/type/Default.class.php b/type/Default.class.php index 9f3b97a..6e7efd9 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -35,13 +35,12 @@ class Type_Default extends Type_Base { } } - if(count($this->files)<=1) { + if ($this->graph_minmax) { $c = 0; foreach ($sources as $source) { $color = is_array($this->colors) ? (isset($this->colors[$source])?$this->colors[$source]:$this->colors[$c++]): $this->colors; - $rrdgraph[] = sprintf('AREA:max_%s#%s', crc32hex($source), $this->get_faded_color($color)); - $rrdgraph[] = sprintf('AREA:min_%s#%s', crc32hex($source), 'ffffff'); - break; # only 1 area to draw + $rrdgraph[] = sprintf('LINE1:max_%s#%s', crc32hex($source), $this->get_faded_color($color)); + $rrdgraph[] = sprintf('LINE1:min_%s#%s', crc32hex($source), $this->get_faded_color($color)); } } -- cgit v1.1