aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/type
diff options
context:
space:
mode:
authorPim van den Berg2010-03-01 20:28:17 +0100
committerPim van den Berg2010-03-01 20:31:30 +0100
commit0b1741c59352a1842f9f81e31b8a8dc5b94323b7 (patch)
tree5e61c3fdc37ef9e52d24a8f626fbdbd65b81f2c3 /type
parentmake rrdfiles using utf8 and spaces work (diff)
downloadapt-panopticon_cgp-0b1741c59352a1842f9f81e31b8a8dc5b94323b7.zip
apt-panopticon_cgp-0b1741c59352a1842f9f81e31b8a8dc5b94323b7.tar.gz
apt-panopticon_cgp-0b1741c59352a1842f9f81e31b8a8dc5b94323b7.tar.bz2
apt-panopticon_cgp-0b1741c59352a1842f9f81e31b8a8dc5b94323b7.tar.xz
utf8 filename support for all types
Types GenenericIO and GenericStacked were not included in commit: 596dd7d414 [make rrdfiles using utf8 and spaces work]
Diffstat (limited to 'type')
-rw-r--r--type/GenericIO.class.php26
-rw-r--r--type/GenericStacked.class.php22
2 files changed, 24 insertions, 24 deletions
diff --git a/type/GenericIO.class.php b/type/GenericIO.class.php
index ee04316..944c82e 100644
--- a/type/GenericIO.class.php
+++ b/type/GenericIO.class.php
@@ -14,9 +14,9 @@ class Type_GenericIO extends Type_Default {
14 $i=0; 14 $i=0;
15 foreach ($this->tinstances as $tinstance) { 15 foreach ($this->tinstances as $tinstance) {
16 foreach ($this->data_sources as $ds) { 16 foreach ($this->data_sources as $ds) {
17 $rrdgraph[] = sprintf('DEF:min_%s%s=%s:%s:MIN', $sources[$i], $raw, $this->files[$tinstance], $ds); 17 $rrdgraph[] = sprintf('DEF:min_%s%s=%s:%s:MIN', crc32hex($sources[$i]), $raw, $this->files[$tinstance], $ds);
18 $rrdgraph[] = sprintf('DEF:avg_%s%s=%s:%s:AVERAGE', $sources[$i], $raw, $this->files[$tinstance], $ds); 18 $rrdgraph[] = sprintf('DEF:avg_%s%s=%s:%s:AVERAGE', crc32hex($sources[$i]), $raw, $this->files[$tinstance], $ds);
19 $rrdgraph[] = sprintf('DEF:max_%s%s=%s:%s:MAX', $sources[$i], $raw, $this->files[$tinstance], $ds); 19 $rrdgraph[] = sprintf('DEF:max_%s%s=%s:%s:MAX', crc32hex($sources[$i]), $raw, $this->files[$tinstance], $ds);
20 $i++; 20 $i++;
21 } 21 }
22 } 22 }
@@ -24,19 +24,19 @@ class Type_GenericIO extends Type_Default {
24 $i=0; 24 $i=0;
25 foreach ($this->tinstances as $tinstance) { 25 foreach ($this->tinstances as $tinstance) {
26 foreach ($this->data_sources as $ds) { 26 foreach ($this->data_sources as $ds) {
27 $rrdgraph[] = sprintf('CDEF:min_%s=min_%1$s_raw,%s,*', $sources[$i], $this->scale); 27 $rrdgraph[] = sprintf('CDEF:min_%s=min_%1$s_raw,%s,*', crc32hex($sources[$i]), $this->scale);
28 $rrdgraph[] = sprintf('CDEF:avg_%s=avg_%1$s_raw,%s,*', $sources[$i], $this->scale); 28 $rrdgraph[] = sprintf('CDEF:avg_%s=avg_%1$s_raw,%s,*', crc32hex($sources[$i]), $this->scale);
29 $rrdgraph[] = sprintf('CDEF:max_%s=max_%1$s_raw,%s,*', $sources[$i], $this->scale); 29 $rrdgraph[] = sprintf('CDEF:max_%s=max_%1$s_raw,%s,*', crc32hex($sources[$i]), $this->scale);
30 $i++; 30 $i++;
31 } 31 }
32 } 32 }
33 } 33 }
34 34
35 $rrdgraph[] = sprintf('CDEF:overlap=avg_%s,avg_%s,LT,avg_%1$s,avg_%2$s,IF', 35 $rrdgraph[] = sprintf('CDEF:overlap=avg_%s,avg_%s,LT,avg_%1$s,avg_%2$s,IF',
36 $sources[0], $sources[1]); 36 crc32hex($sources[0]), crc32hex($sources[1]));
37 37
38 foreach($sources as $source) { 38 foreach($sources as $source) {
39 $rrdgraph[] = sprintf('AREA:avg_%s#%s', $source, $this->get_faded_color($this->colors[$source])); 39 $rrdgraph[] = sprintf('AREA:avg_%s#%s', crc32hex($source), $this->get_faded_color($this->colors[$source]));
40 } 40 }
41 41
42 $rrdgraph[] = sprintf('AREA:overlap#%s', 42 $rrdgraph[] = sprintf('AREA:overlap#%s',
@@ -48,11 +48,11 @@ class Type_GenericIO extends Type_Default {
48 48
49 foreach($sources as $source) { 49 foreach($sources as $source) {
50 $dsname = $this->ds_names[$source] != '' ? $this->ds_names[$source] : $source; 50 $dsname = $this->ds_names[$source] != '' ? $this->ds_names[$source] : $source;
51 $rrdgraph[] = sprintf('LINE1:avg_%s#%s:\'%s\'', $source, $this->colors[$source], $dsname); 51 $rrdgraph[] = sprintf('LINE1:avg_%s#%s:\'%s\'', crc32hex($source), $this->colors[$source], $dsname);
52 $rrdgraph[] = sprintf('GPRINT:min_%s:MIN:\'%s Min,\'', $source, $this->rrd_format); 52 $rrdgraph[] = sprintf('GPRINT:min_%s:MIN:\'%s Min,\'', crc32hex($source), $this->rrd_format);
53 $rrdgraph[] = sprintf('GPRINT:avg_%s:AVERAGE:\'%s Avg,\'', $source, $this->rrd_format); 53 $rrdgraph[] = sprintf('GPRINT:avg_%s:AVERAGE:\'%s Avg,\'', crc32hex($source), $this->rrd_format);
54 $rrdgraph[] = sprintf('GPRINT:max_%s:MAX:\'%s Max,\'', $source, $this->rrd_format); 54 $rrdgraph[] = sprintf('GPRINT:max_%s:MAX:\'%s Max,\'', crc32hex($source), $this->rrd_format);
55 $rrdgraph[] = sprintf('GPRINT:avg_%s:LAST:\'%s Last\l\'', $source, $this->rrd_format); 55 $rrdgraph[] = sprintf('GPRINT:avg_%s:LAST:\'%s Last\l\'', crc32hex($source), $this->rrd_format);
56 } 56 }
57 57
58 return $rrdgraph; 58 return $rrdgraph;
diff --git a/type/GenericStacked.class.php b/type/GenericStacked.class.php
index 7595385..89e9f65 100644
--- a/type/GenericStacked.class.php
+++ b/type/GenericStacked.class.php
@@ -12,32 +12,32 @@ class Type_GenericStacked extends Type_Default {
12 $i=0; 12 $i=0;
13 foreach ($this->tinstances as $tinstance) { 13 foreach ($this->tinstances as $tinstance) {
14 foreach ($this->data_sources as $ds) { 14 foreach ($this->data_sources as $ds) {
15 $rrdgraph[] = sprintf('DEF:min_%s=%s:%s:MIN', $sources[$i], $this->files[$tinstance], $ds); 15 $rrdgraph[] = sprintf('DEF:min_%s=%s:%s:MIN', crc32hex($sources[$i]), $this->files[$tinstance], $ds);
16 $rrdgraph[] = sprintf('DEF:avg_%s=%s:%s:AVERAGE', $sources[$i], $this->files[$tinstance], $ds); 16 $rrdgraph[] = sprintf('DEF:avg_%s=%s:%s:AVERAGE', crc32hex($sources[$i]), $this->files[$tinstance], $ds);
17 $rrdgraph[] = sprintf('DEF:max_%s=%s:%s:MAX', $sources[$i], $this->files[$tinstance], $ds); 17 $rrdgraph[] = sprintf('DEF:max_%s=%s:%s:MAX', crc32hex($sources[$i]), $this->files[$tinstance], $ds);
18 $i++; 18 $i++;
19 } 19 }
20 } 20 }
21 21
22 for ($i=count($sources)-1 ; $i>=0 ; $i--) { 22 for ($i=count($sources)-1 ; $i>=0 ; $i--) {
23 if ($i == (count($sources)-1)) 23 if ($i == (count($sources)-1))
24 $rrdgraph[] = sprintf('CDEF:area_%s=avg_%1$s', $sources[$i]); 24 $rrdgraph[] = sprintf('CDEF:area_%s=avg_%1$s', crc32hex($sources[$i]));
25 else 25 else
26 $rrdgraph[] = sprintf('CDEF:area_%s=area_%s,avg_%1$s,+', $sources[$i], $sources[$i+1]); 26 $rrdgraph[] = sprintf('CDEF:area_%s=area_%s,avg_%1$s,+', crc32hex($sources[$i]), crc32hex($sources[$i+1]));
27 } 27 }
28 28
29 foreach ($sources as $source) { 29 foreach ($sources as $source) {
30 $color = $this->get_faded_color($this->colors[$source]); 30 $color = $this->get_faded_color($this->colors[$source]);
31 $rrdgraph[] = sprintf('AREA:area_%s#%s', $source, $color); 31 $rrdgraph[] = sprintf('AREA:area_%s#%s', crc32hex($source), $color);
32 } 32 }
33 33
34 foreach ($sources as $source) { 34 foreach ($sources as $source) {
35 $dsname = $this->ds_names[$source] != '' ? $this->ds_names[$source] : $source; 35 $dsname = $this->ds_names[$source] != '' ? $this->ds_names[$source] : $source;
36 $rrdgraph[] = sprintf('LINE1:area_%s#%s:\'%s\'', $source, $this->validate_color($this->colors[$source]), $dsname); 36 $rrdgraph[] = sprintf('LINE1:area_%s#%s:\'%s\'', crc32hex($source), $this->validate_color($this->colors[$source]), $dsname);
37 $rrdgraph[] = sprintf('GPRINT:min_%s:MIN:\'%s Min,\'', $source, $this->rrd_format); 37 $rrdgraph[] = sprintf('GPRINT:min_%s:MIN:\'%s Min,\'', crc32hex($source), $this->rrd_format);
38 $rrdgraph[] = sprintf('GPRINT:avg_%s:AVERAGE:\'%s Avg,\'', $source, $this->rrd_format); 38 $rrdgraph[] = sprintf('GPRINT:avg_%s:AVERAGE:\'%s Avg,\'', crc32hex($source), $this->rrd_format);
39 $rrdgraph[] = sprintf('GPRINT:max_%s:MAX:\'%s Max,\'', $source, $this->rrd_format); 39 $rrdgraph[] = sprintf('GPRINT:max_%s:MAX:\'%s Max,\'', crc32hex($source), $this->rrd_format);
40 $rrdgraph[] = sprintf('GPRINT:avg_%s:LAST:\'%s Last\\l\'', $source, $this->rrd_format); 40 $rrdgraph[] = sprintf('GPRINT:avg_%s:LAST:\'%s Last\\l\'', crc32hex($source), $this->rrd_format);
41 } 41 }
42 42
43 return $rrdgraph; 43 return $rrdgraph;