From ff9d09911b64ea9fef91ebd3bc522efffec64c30 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Mon, 12 Dec 2011 12:05:25 +0000 Subject: [PATCH] more accurate 95th (order by rate, not delta, duh) git-svn-id: http://www.observium.org/svn/observer/trunk@2772 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/billing.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/billing.php b/includes/billing.php index 9d6dc7fcdf..27b20dafd8 100644 --- a/includes/billing.php +++ b/includes/billing.php @@ -117,7 +117,7 @@ function get95thin($bill_id,$datefrom,$dateto) $measurement_95th = round($measurements /100 * 95) - 1; $q_95_sql = "SELECT (in_delta / period * 8) AS rate FROM bill_data WHERE bill_id = '".mres($bill_id)."'"; - $q_95_sql .= " AND timestamp > '".mres($datefrom)."' AND timestamp <= '".mres($dateto)."' ORDER BY in_delta ASC"; + $q_95_sql .= " AND timestamp > '".mres($datefrom)."' AND timestamp <= '".mres($dateto)."' ORDER BY rate ASC"; $a_95th = dbFetchColumn($q_95_sql); $m_95th = $a_95th[$measurement_95th]; @@ -132,7 +132,7 @@ function get95thout($bill_id,$datefrom,$dateto) $measurement_95th = round($measurements /100 * 95) - 1; $q_95_sql = "SELECT (out_delta / period * 8) AS rate FROM bill_data WHERE bill_id = '".mres($bill_id)."'"; - $q_95_sql .= " AND timestamp > '".mres($datefrom)."' AND timestamp <= '".mres($dateto)."' ORDER BY out_delta ASC"; + $q_95_sql .= " AND timestamp > '".mres($datefrom)."' AND timestamp <= '".mres($dateto)."' ORDER BY rate ASC"; $a_95th = dbFetchColumn($q_95_sql); $m_95th = $a_95th[$measurement_95th];