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
This commit is contained in:
Adam Amstrong
2011-12-12 12:05:25 +00:00
parent f2733cf2e6
commit ff9d09911b

View File

@@ -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];