mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge pull request #15794 from SimonWalton-HiFi/limit-stats-dump-rate
Limit the stats-dump rate on packet error
This commit is contained in:
commit
ff1d828aaa
2 changed files with 13 additions and 7 deletions
|
@ -450,13 +450,16 @@ qint64 LimitedNodeList::sendPacket(std::unique_ptr<NLPacket> packet, const HifiS
|
|||
auto size = sendUnreliablePacket(*packet, sockAddr, hmacAuth);
|
||||
if (size < 0) {
|
||||
auto now = usecTimestampNow();
|
||||
eachNode([now](const SharedNodePointer & node) {
|
||||
qCDebug(networking) << "Stats for " << node->getPublicSocket() << "\n"
|
||||
<< " Last Heard Microstamp: " << node->getLastHeardMicrostamp() << " (" << (now - node->getLastHeardMicrostamp()) << "usec ago)\n"
|
||||
<< " Outbound Kbps: " << node->getOutboundKbps() << "\n"
|
||||
<< " Inbound Kbps: " << node->getInboundKbps() << "\n"
|
||||
<< " Ping: " << node->getPingMs();
|
||||
});
|
||||
if (now - _sendErrorStatsTime > ERROR_STATS_PERIOD_US) {
|
||||
_sendErrorStatsTime = now;
|
||||
eachNode([now](const SharedNodePointer& node) {
|
||||
qCDebug(networking) << "Stats for " << node->getPublicSocket() << "\n"
|
||||
<< " Last Heard Microstamp: " << node->getLastHeardMicrostamp() << " (" << (now - node->getLastHeardMicrostamp()) << "usec ago)\n"
|
||||
<< " Outbound Kbps: " << node->getOutboundKbps() << "\n"
|
||||
<< " Inbound Kbps: " << node->getInboundKbps() << "\n"
|
||||
<< " Ping: " << node->getPingMs();
|
||||
});
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
|
|
@ -497,6 +497,9 @@ private:
|
|||
float _outboundKbps { 0.0f };
|
||||
|
||||
bool _dropOutgoingNodeTraffic { false };
|
||||
|
||||
quint64 _sendErrorStatsTime { (quint64)0 };
|
||||
static const quint64 ERROR_STATS_PERIOD_US { 1 * USECS_PER_SECOND };
|
||||
};
|
||||
|
||||
#endif // hifi_LimitedNodeList_h
|
||||
|
|
Loading…
Reference in a new issue