From 74538ba292cd83ffd8eccdf7a677223db9267317 Mon Sep 17 00:00:00 2001 From: Ian Berry Date: Fri, 11 Jul 2003 01:46:45 +0000 Subject: [PATCH] fixed some divide by 0 problems and issues when there is no data with 95th percentile git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/trunk/cacti@1097 860744bd-22fc-0310-8c96-e9fe5004b5ca --- lib/rrd.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/rrd.php b/lib/rrd.php index f5cb20b0b8..625c2ad35b 100644 --- a/lib/rrd.php +++ b/lib/rrd.php @@ -253,6 +253,10 @@ function cmp($a, $b) { } function ninety_fifth_percentile($local_data_id, $seconds) { + if (empty($local_data_id)) { + return; + } + $data_source_path = get_data_source_path($local_data_id, true); /* build and run the rrdtool fetch command with all of our data */ @@ -536,7 +540,7 @@ function rrdtool_function_graph($local_graph_id, $rra_id, $graph_data_array) { } }elseif ($match[3] == "total") { for ($t=0;($t