mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Change Billing Graph Data Max/Avg/Last from bytes to bits (#8270)
This commit is contained in:
committed by
Neil Lathwood
parent
0250c5ce7d
commit
37bdba7c0a
@@ -277,8 +277,8 @@ function getBillingBitsGraphData($bill_id, $from, $to, $reducefactor)
|
||||
}
|
||||
|
||||
$period = $row['period'];
|
||||
$in_delta = $row['in_delta'];
|
||||
$out_delta = $row['out_delta'];
|
||||
$in_delta = $row['in_delta'] * 8;
|
||||
$out_delta = $row['out_delta'] * 8;
|
||||
$last = $timestamp;
|
||||
|
||||
$iter_in += $in_delta;
|
||||
@@ -293,8 +293,8 @@ function getBillingBitsGraphData($bill_id, $from, $to, $reducefactor)
|
||||
$tot_period+= $period;
|
||||
|
||||
if (++$iter >= $reducefactor) {
|
||||
$out_data[$i] = round(($iter_out * 8 / $iter_period), 2);
|
||||
$in_data[$i] = round(($iter_in * 8 / $iter_period), 2);
|
||||
$out_data[$i] = round(($iter_out / $iter_period), 2);
|
||||
$in_data[$i] = round(($iter_in / $iter_period), 2);
|
||||
$tot_data[$i] = ($out_data[$i] + $in_data[$i]);
|
||||
$ticks[$i] = $timestamp;
|
||||
$i++;
|
||||
@@ -305,8 +305,8 @@ function getBillingBitsGraphData($bill_id, $from, $to, $reducefactor)
|
||||
}//end foreach
|
||||
|
||||
if (isset($iter_in)) { // Write last element
|
||||
$out_data[$i] = round(($iter_out * 8 / $iter_period), 2);
|
||||
$in_data[$i] = round(($iter_in * 8 / $iter_period), 2);
|
||||
$out_data[$i] = round(($iter_out / $iter_period), 2);
|
||||
$in_data[$i] = round(($iter_in / $iter_period), 2);
|
||||
$tot_data[$i] = ($out_data[$i] + $in_data[$i]);
|
||||
$ticks[$i] = $timestamp;
|
||||
$i++;
|
||||
|
Reference in New Issue
Block a user