Skip to content

Commit

Permalink
Fix more percent calculations (librenms#14294)
Browse files Browse the repository at this point in the history
  • Loading branch information
murrant authored Sep 5, 2022
1 parent c03954c commit 8f5582f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/html/api_functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ function get_port_stats_by_port_hostname(Illuminate\Http\Request $request)
$out_rate = $port['ifOutOctets_rate'] * 8;
$port['in_rate'] = Number::formatSi($in_rate, 2, 3, 'bps');
$port['out_rate'] = Number::formatSi($out_rate, 2, 3, 'bps');
$port['in_perc'] = number_format($in_rate / $port['ifSpeed'] * 100, 2, '.', '');
$port['out_perc'] = number_format($out_rate / $port['ifSpeed'] * 100, 2, '.', '');
$port['in_perc'] = Number::calculatePercent($in_rate, $port['ifSpeed']);
$port['out_perc'] = Number::calculatePercent($out_rate, $port['ifSpeed']);
$port['in_pps'] = Number::formatBi($port['ifInUcastPkts_rate'], 2, 3, '');
$port['out_pps'] = Number::formatBi($port['ifOutUcastPkts_rate'], 2, 3, '');

Expand Down

0 comments on commit 8f5582f

Please sign in to comment.