diff options
| author | Pim van den Berg | 2013-05-18 22:53:39 +0200 |
|---|---|---|
| committer | Pim van den Berg | 2013-05-18 22:53:39 +0200 |
| commit | 3deff291c5713091bdb0346752796b47afc03879 (patch) | |
| tree | 307e9862a264d2bb665d14639b64d5f0beb7c638 | |
| parent | type/default: add missing initial variable definitions (diff) | |
| download | apt-panopticon_cgp-3deff291c5713091bdb0346752796b47afc03879.zip apt-panopticon_cgp-3deff291c5713091bdb0346752796b47afc03879.tar.gz apt-panopticon_cgp-3deff291c5713091bdb0346752796b47afc03879.tar.bz2 apt-panopticon_cgp-3deff291c5713091bdb0346752796b47afc03879.tar.xz | |
add config option for showing smooth (curved) graphs
| -rw-r--r-- | conf/config.php | 3 | ||||
| -rw-r--r-- | type/Default.class.php | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/conf/config.php b/conf/config.php index c734b09..685589d 100644 --- a/conf/config.php +++ b/conf/config.php | |||
| @@ -48,6 +48,9 @@ $CONFIG['graph_type'] = 'png'; | |||
| 48 | # use the negative X-axis in I/O graphs | 48 | # use the negative X-axis in I/O graphs |
| 49 | $CONFIG['negative_io'] = false; | 49 | $CONFIG['negative_io'] = false; |
| 50 | 50 | ||
| 51 | # create smooth graphs (rrdtool -E) | ||
| 52 | $CONFIG['graph_smooth'] = false; | ||
| 53 | |||
| 51 | # browser cache time for the graphs (in seconds) | 54 | # browser cache time for the graphs (in seconds) |
| 52 | $CONFIG['cache'] = 90; | 55 | $CONFIG['cache'] = 90; |
| 53 | 56 | ||
diff --git a/type/Default.class.php b/type/Default.class.php index dfbf2da..42d5090 100644 --- a/type/Default.class.php +++ b/type/Default.class.php | |||
| @@ -21,6 +21,7 @@ class Type_Default { | |||
| 21 | var $heigth; | 21 | var $heigth; |
| 22 | var $graph_type; | 22 | var $graph_type; |
| 23 | var $negative_io; | 23 | var $negative_io; |
| 24 | var $graph_smooth; | ||
| 24 | 25 | ||
| 25 | var $files; | 26 | var $files; |
| 26 | var $tinstances; | 27 | var $tinstances; |
| @@ -40,6 +41,7 @@ class Type_Default { | |||
| 40 | if (empty($this->heigth)) $this->heigth = $config['heigth']; | 41 | if (empty($this->heigth)) $this->heigth = $config['heigth']; |
| 41 | $this->graph_type = $config['graph_type']; | 42 | $this->graph_type = $config['graph_type']; |
| 42 | $this->negative_io = $config['negative_io']; | 43 | $this->negative_io = $config['negative_io']; |
| 44 | $this->graph_smooth = $config['graph_smooth']; | ||
| 43 | } | 45 | } |
| 44 | 46 | ||
| 45 | function rainbow_colors() { | 47 | function rainbow_colors() { |
| @@ -211,6 +213,8 @@ class Type_Default { | |||
| 211 | } | 213 | } |
| 212 | if ($this->rrdtool_opts != '') | 214 | if ($this->rrdtool_opts != '') |
| 213 | $rrdgraph[] = $this->rrdtool_opts; | 215 | $rrdgraph[] = $this->rrdtool_opts; |
| 216 | if ($this->graph_smooth) | ||
| 217 | $rrdgraph[] = '-E'; | ||
| 214 | $rrdgraph[] = sprintf('-w %d', is_numeric($this->width) ? $this->width : 400); | 218 | $rrdgraph[] = sprintf('-w %d', is_numeric($this->width) ? $this->width : 400); |
| 215 | $rrdgraph[] = sprintf('-h %d', is_numeric($this->heigth) ? $this->heigth : 175); | 219 | $rrdgraph[] = sprintf('-h %d', is_numeric($this->heigth) ? $this->heigth : 175); |
| 216 | $rrdgraph[] = '-l 0'; | 220 | $rrdgraph[] = '-l 0'; |
