diff options
Diffstat (limited to '')
-rw-r--r-- | type/Base.class.php | 1 | ||||
-rw-r--r-- | type/GenericIO.class.php | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/type/Base.class.php b/type/Base.class.php index 40f3df0..883c98f 100644 --- a/type/Base.class.php +++ b/type/Base.class.php | |||
@@ -22,6 +22,7 @@ class Type_Base { | |||
22 | var $height; | 22 | var $height; |
23 | var $graph_type; | 23 | var $graph_type; |
24 | var $negative_io; | 24 | var $negative_io; |
25 | var $percentile = false; | ||
25 | var $graph_smooth; | 26 | var $graph_smooth; |
26 | 27 | ||
27 | var $files; | 28 | var $files; |
diff --git a/type/GenericIO.class.php b/type/GenericIO.class.php index fac7034..a9d58cd 100644 --- a/type/GenericIO.class.php +++ b/type/GenericIO.class.php | |||
@@ -33,6 +33,8 @@ class Type_GenericIO extends Type_Base { | |||
33 | if ($i == 1) | 33 | if ($i == 1) |
34 | $rrdgraph[] = sprintf('CDEF:avg_%s_neg=avg_%1$s_raw,%s%s,*', crc32hex($sources[$i]), $this->negative_io ? '-' : '', $this->scale); | 34 | $rrdgraph[] = sprintf('CDEF:avg_%s_neg=avg_%1$s_raw,%s%s,*', crc32hex($sources[$i]), $this->negative_io ? '-' : '', $this->scale); |
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) | ||
37 | $rrdgraph[] = sprintf('VDEF:pct_%1$s=avg_%1$s_raw,%2$s,PERCENT', crc32hex($sources[$i]), $this->percentile); | ||
36 | $i++; | 38 | $i++; |
37 | } | 39 | } |
38 | } | 40 | } |
@@ -66,6 +68,15 @@ class Type_GenericIO extends Type_Base { | |||
66 | $i++; | 68 | $i++; |
67 | } | 69 | } |
68 | 70 | ||
71 | if ($this->percentile) { | ||
72 | $rrdgraph[] = sprintf('"COMMENT: \l"'); | ||
73 | foreach($sources as $source) { | ||
74 | $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)); | ||
76 | $rrdgraph[] = sprintf('"GPRINT:pct_%s:%s\l"', crc32hex($source), $this->rrd_format); | ||
77 | } | ||
78 | } | ||
79 | |||
69 | return $rrdgraph; | 80 | return $rrdgraph; |
70 | } | 81 | } |
71 | } | 82 | } |