"; return; } } /* bandwidth_summation - given a data source, sums all data in the rrd for a given time period @arg $local_data_id - the data source to perform the summation for @arg $seconds - the number of seconds into the past to perform the calculation for @arg $resolution - the accuracy of the data measured in seconds @arg $rra_steps - how many periods each sample in the RRA counts for, values above '1' result in an averaged summation @arg $ds_steps - how many seconds each period represents @returns - (array) an array containing each data source item, and its sum */ function bandwidth_summation($local_data_id, $seconds, $resolution, $rra_steps, $ds_steps) { $fetch_array = rrdtool_function_fetch($local_data_id, $seconds, $resolution); /* loop through each regexp determined above (or each data source) */ for ($i=0;$i"; return; } } /* 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 should be formatted like so: $arr[0] // full variable string $arr[1] // bits or bytes $arr[2] // power of 10 divisor $arr[3] // current, total, or max $arr[4] // digits of floating point precision @arg $graph_item - an array that contains the current graph item @arg $graph_items - an array that contains all graph items @arg $graph_start - the start of the graph in seconds or the number of seconds to perform the 95th percentile calculation for @arg $seconds_between_graph_updates - the number of seconds between each update on the graph which 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, $seconds_between_graph_updates) { global $ninety_fifth_cache, $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"], abs($graph_start), $seconds_between_graph_updates); } }elseif ($regexp_match_array[3] == "total") { for ($t=0;($t