mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added aggregate config option to Billing 95th percentile calculations (#10202)
* Added configuration options to aggregate input and output bits before making 95th percentile billing calculations * Changed aggregate to per-bill instead of global. Added config options for making aggregate the default selected option. Refactored out mres() calls in touched files. Changed to Config::get where appropriate. * Fixed documentation typo * Fixed scope of aggregate default config option to be under billing
This commit is contained in:
@@ -39,8 +39,11 @@ foreach (dbFetchRows('SELECT * FROM `bills` ORDER BY `bill_id`') as $bill) {
|
||||
|
||||
$date_updated = str_replace('-', '', str_replace(':', '', str_replace(' ', '', $check['updated'])));
|
||||
|
||||
// Send the current dir_95th to the getRates function so it knows to aggregate or return the max in/out value and highest direction
|
||||
$dir_95th = $bill['dir_95th'];
|
||||
|
||||
if ($period > 0 && $dateto > $date_updated) {
|
||||
$rate_data = getRates($bill['bill_id'], $datefrom, $dateto);
|
||||
$rate_data = getRates($bill['bill_id'], $datefrom, $dateto, $dir_95th);
|
||||
$rate_95th = $rate_data['rate_95th'];
|
||||
$dir_95th = $rate_data['dir_95th'];
|
||||
$total_data = $rate_data['total_data'];
|
||||
|
Reference in New Issue
Block a user