Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Fixed rx/tx rate stats on BSP/OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
pstavirs committed Jul 22, 2012
1 parent 19424d9 commit f7d8cc2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server/bsdport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ void BsdPort::StatsMonitor::run()
stats->rxPkts = in_packets;
stats->rxBytes = ifd->ifi_ibytes;
stats->txPps =
((ifd->ifi_opackets >= stats->rxPkts) ?
ifd->ifi_opackets - stats->rxPkts :
ifd->ifi_opackets + (kMaxValue32 - stats->rxPkts))
((ifd->ifi_opackets >= stats->txPkts) ?
ifd->ifi_opackets - stats->txPkts :
ifd->ifi_opackets + (kMaxValue32 - stats->txPkts))
/ kRefreshFreq_;
stats->txBps =
((ifd->ifi_obytes >= stats->rxBytes) ?
ifd->ifi_obytes - stats->rxBytes :
ifd->ifi_obytes + (kMaxValue32 - stats->rxBytes))
((ifd->ifi_obytes >= stats->txBytes) ?
ifd->ifi_obytes - stats->txBytes :
ifd->ifi_obytes + (kMaxValue32 - stats->txBytes))
/ kRefreshFreq_;
stats->txPkts = ifd->ifi_opackets;
stats->txBytes = ifd->ifi_obytes;
Expand Down

0 comments on commit f7d8cc2

Please sign in to comment.