diff -ruBbd cacti-0.8.6b/lib/graph_variables.php cacti-0.8.6b-new/lib/graph_variables.php --- cacti-0.8.6b/lib/graph_variables.php 2004-12-01 19:50:28.000000000 -0500 +++ cacti-0.8.6b-new/lib/graph_variables.php 2004-12-01 19:50:45.000000000 -0500 @@ -111,9 +111,6 @@ return $return_array; } -/* this variable is used as a cache to prevent extra calls to ninety_fifth_percentile() */ -$ninety_fifth_cache = array(); - /* variable_ninety_fifth_percentile - given a 95th percentile variable, calculate the 95th percentile and format it for display on the graph @arg $regexp_match_array - the array that contains each argument in the 95th percentile variable. it @@ -133,19 +130,17 @@ varies depending on the RRA in use @returns - a string containg the 95th percentile suitable for placing on the graph */ function variable_ninety_fifth_percentile(&$regexp_match_array, &$graph_item, &$graph_items, $graph_start, $graph_end) { - global $ninety_fifth_cache, $graph_item_types; + global $graph_item_types; if (sizeof($regexp_match_array) == 0) { return 0; } if (($regexp_match_array[3] == "current") || ($regexp_match_array[3] == "max")) { - if (!isset($ninety_fifth_cache{$graph_item["local_data_id"]})) { $ninety_fifth_cache{$graph_item["local_data_id"]} = ninety_fifth_percentile($graph_item["local_data_id"], $graph_start, $graph_end); - } }elseif ($regexp_match_array[3] == "total") { for ($t=0;($t= MAX_FETCH_CACHE_SIZE) { + $rrd_fetch_cache = array(); + } + + /* update the cache */ + if (MAX_FETCH_CACHE_SIZE > 0) { + $rrd_fetch_cache[$current_hash_cache] = $fetch_array; + } + return $fetch_array; }