diff options
| author | Pim van den Berg | 2015-05-28 23:08:50 +0200 |
|---|---|---|
| committer | Pim van den Berg | 2015-05-28 23:08:50 +0200 |
| commit | abd6ea89220d9f427542ca7b4803caa9d9978df2 (patch) | |
| tree | be185351e8a7c1a2f0572d67ffa5798d3a120040 /type/GenericIO.class.php | |
| parent | inc/functions: merge functions GET and validate_get (diff) | |
| download | apt-panopticon_cgp-abd6ea89220d9f427542ca7b4803caa9d9978df2.zip apt-panopticon_cgp-abd6ea89220d9f427542ca7b4803caa9d9978df2.tar.gz apt-panopticon_cgp-abd6ea89220d9f427542ca7b4803caa9d9978df2.tar.bz2 apt-panopticon_cgp-abd6ea89220d9f427542ca7b4803caa9d9978df2.tar.xz | |
type/GenericIO: in case of negative_io draw percentile line also on the negative y-axis
Closes #119
Diffstat (limited to 'type/GenericIO.class.php')
| -rw-r--r-- | type/GenericIO.class.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/type/GenericIO.class.php b/type/GenericIO.class.php index a0a9666..3a29948 100644 --- a/type/GenericIO.class.php +++ b/type/GenericIO.class.php | |||
| @@ -35,6 +35,8 @@ class Type_GenericIO extends Type_Base { | |||
| 35 | $rrdgraph[] = sprintf('VDEF:tot_%1$s=avg_%1$s,TOTAL', crc32hex($sources[$i])); | 35 | $rrdgraph[] = sprintf('VDEF:tot_%1$s=avg_%1$s,TOTAL', crc32hex($sources[$i])); |
| 36 | if ($this->percentile) | 36 | if ($this->percentile) |
| 37 | $rrdgraph[] = sprintf('VDEF:pct_%1$s=avg_%1$s,%2$s,PERCENT', crc32hex($sources[$i]), $this->percentile); | 37 | $rrdgraph[] = sprintf('VDEF:pct_%1$s=avg_%1$s,%2$s,PERCENT', crc32hex($sources[$i]), $this->percentile); |
| 38 | if ($this->percentile && $this->negative_io && $i == 1) | ||
| 39 | $rrdgraph[] = sprintf('VDEF:pct_%1$s_neg=avg_%1$s_neg,%2$s,PERCENT', crc32hex($sources[$i]), 100 - $this->percentile); | ||
| 38 | $i++; | 40 | $i++; |
| 39 | } | 41 | } |
| 40 | } | 42 | } |
| @@ -70,10 +72,12 @@ class Type_GenericIO extends Type_Base { | |||
| 70 | 72 | ||
| 71 | if ($this->percentile) { | 73 | if ($this->percentile) { |
| 72 | $rrdgraph[] = 'COMMENT: \l'; | 74 | $rrdgraph[] = 'COMMENT: \l'; |
| 75 | $i=0; | ||
| 73 | foreach($sources as $source) { | 76 | foreach($sources as $source) { |
| 74 | $legend = empty($this->legend[$source]) ? $source : $this->legend[$source]; | 77 | $legend = empty($this->legend[$source]) ? $source : $this->legend[$source]; |
| 75 | $rrdgraph[] = sprintf('HRULE:pct_%s#%s:%sth Percentile %s', crc32hex($source), $this->get_faded_color($this->colors[$source], '000000', 0.6), $this->percentile, $this->rrd_escape($legend)); | 78 | $rrdgraph[] = sprintf('LINE:pct_%s%s#%s:%sth Percentile %s', crc32hex($source), ($i == 1 && $this->negative_io) ? '_neg' : '', $this->get_faded_color($this->colors[$source], '000000', 0.6), $this->percentile, $this->rrd_escape($legend)); |
| 76 | $rrdgraph[] = sprintf('GPRINT:pct_%s:%s\l', crc32hex($source), $this->rrd_format); | 79 | $rrdgraph[] = sprintf('GPRINT:pct_%s:%s\l', crc32hex($source), $this->rrd_format); |
| 80 | $i++; | ||
| 77 | } | 81 | } |
| 78 | } | 82 | } |
| 79 | 83 | ||
