]> git.pld-linux.org Git - packages/cacti.git/blame - nth_percentile_empty_return_set_issue.patch
*** empty log message ***
[packages/cacti.git] / nth_percentile_empty_return_set_issue.patch
CommitLineData
fdcfda25
AM
1--- cacti-0.8.6h/lib/graph_variables.php 2006-01-03 21:08:30.000000000 -0600
2+++ cacti-fixed/lib/graph_variables.php 2006-01-06 22:40:31.032460462 -0600
3@@ -302,27 +302,34 @@
4
5 /* format the output according to args passed to the variable */
6 if ($regexp_match_array[4] == "current") {
7+ if (! empty($nth_cache{$graph_item["local_data_id"]}{$graph_item["data_source_name"]})) {
8 $nth = $nth_cache{$graph_item["local_data_id"]}{$graph_item["data_source_name"]};
9 $nth = ($regexp_match_array[2] == "bits") ? $nth * 8 : $nth;
10 $nth /= pow(10,intval($regexp_match_array[3]));
11+ }
12 }elseif ($regexp_match_array[4] == "total") {
13 for ($t=0;($t<count($graph_items));$t++) {
14 if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
15+ if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]})) {
16 $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]};
17 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
18 $local_nth /= pow(10,intval($regexp_match_array[3]));
19
20 $nth += $local_nth;
21+ }
22
23 }
24 }
25 }elseif ($regexp_match_array[4] == "max") {
26+ if (! empty($nth_cache{$graph_item["local_data_id"]}["nth_percentile_maximum"])) {
27 $nth = $nth_cache{$graph_item["local_data_id"]}["nth_percentile_maximum"];
28 $nth = ($regexp_match_array[2] == "bits") ? $nth * 8 : $nth;
29 $nth /= pow(10,intval($regexp_match_array[3]));
30+ }
31 }elseif ($regexp_match_array[4] == "total_peak") {
32 for ($t=0;($t<count($graph_items));$t++) {
33 if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
34+ if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"])) {
35 $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"];
36 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
37 $local_nth /= pow(10,intval($regexp_match_array[3]));
38@@ -330,9 +337,11 @@
39 $nth += $local_nth;
40 }
41 }
42+ }
43 }elseif ($regexp_match_array[4] == "all_max_current") {
44 for ($t=0;($t<count($graph_items));$t++) {
45 if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
46+ if (! empty($ninety_fifth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]})) {
47 $local_nth = $ninety_fifth_cache{$graph_items[$t]["local_data_id"]}{$graph_items[$t]["data_source_name"]};
48 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
49 $local_nth /= pow(10,intval($regexp_match_array[3]));
50@@ -342,9 +351,11 @@
51 }
52 }
53 }
54+ }
55 }elseif ($regexp_match_array[4] == "all_max_peak") {
56 for ($t=0;($t<count($graph_items));$t++) {
57 if ((ereg("(AREA|STACK|LINE[123])", $graph_item_types{$graph_items[$t]["graph_type_id"]})) && (!empty($graph_items[$t]["data_template_rrd_id"]))) {
58+ if (! empty($nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"])) {
59 $local_nth = $nth_cache{$graph_items[$t]["local_data_id"]}["nth_percentile_maximum"];
60 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
61 $local_nth /= pow(10,intval($regexp_match_array[3]));
62@@ -354,28 +365,23 @@
63 }
64 }
65 }
66+ }
67 }elseif ($regexp_match_array[4] == "aggregate") {
68- if (empty($nth_cache{0}["nth_percentile_aggregate_total"])) {
69- $nth = 0;
70- }else{
71+ if (! empty($nth_cache{0}["nth_percentile_aggregate_total"])) {
72 $local_nth = $nth_cache{0}["nth_percentile_aggregate_total"];
73 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
74 $local_nth /= pow(10,intval($regexp_match_array[3]));
75 $nth = $local_nth;
76 }
77 }elseif ($regexp_match_array[4] == "aggregate_max") {
78- if (empty($nth_cache{0}["nth_percentile_aggregate_max"])) {
79- $nth = 0;
80- }else{
81+ if (! empty($nth_cache{0}["nth_percentile_aggregate_max"])) {
82 $local_nth = $nth_cache{0}["nth_percentile_aggregate_max"];
83 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
84 $local_nth /= pow(10,intval($regexp_match_array[3]));
85 $nth = $local_nth;
86 }
87 }elseif ($regexp_match_array[4] == "aggregate_sum") {
88- if (empty($nth_cache{0}["nth_percentile_aggregate_sum"])) {
89- $nth = 0;
90- }else{
91+ if (! empty($nth_cache{0}["nth_percentile_aggregate_sum"])) {
92 $local_nth = $nth_cache{0}["nth_percentile_aggregate_sum"];
93 $local_nth = ($regexp_match_array[2] == "bits") ? $local_nth * 8 : $local_nth;
94 $local_nth /= pow(10,intval($regexp_match_array[3]));
This page took 0.03487 seconds and 4 git commands to generate.