diff options
Diffstat (limited to 'type/GenericIO.class.php')
-rw-r--r-- | type/GenericIO.class.php | 11 |
1 files changed, 11 insertions, 0 deletions
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 | } |