mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-17 05:58:05 +02:00
Limit the stats-dump on packet error
This commit is contained in:
parent
723b4ac30f
commit
06b00e93ae
2 changed files with 13 additions and 7 deletions
|
@ -450,7 +450,9 @@ qint64 LimitedNodeList::sendPacket(std::unique_ptr<NLPacket> packet, const HifiS
|
||||||
auto size = sendUnreliablePacket(*packet, sockAddr, hmacAuth);
|
auto size = sendUnreliablePacket(*packet, sockAddr, hmacAuth);
|
||||||
if (size < 0) {
|
if (size < 0) {
|
||||||
auto now = usecTimestampNow();
|
auto now = usecTimestampNow();
|
||||||
eachNode([now](const SharedNodePointer & node) {
|
if (now - _sendErrorStatsTime > ERROR_STATS_PERIOD_US) {
|
||||||
|
_sendErrorStatsTime = now;
|
||||||
|
eachNode([now](const SharedNodePointer& node) {
|
||||||
qCDebug(networking) << "Stats for " << node->getPublicSocket() << "\n"
|
qCDebug(networking) << "Stats for " << node->getPublicSocket() << "\n"
|
||||||
<< " Last Heard Microstamp: " << node->getLastHeardMicrostamp() << " (" << (now - node->getLastHeardMicrostamp()) << "usec ago)\n"
|
<< " Last Heard Microstamp: " << node->getLastHeardMicrostamp() << " (" << (now - node->getLastHeardMicrostamp()) << "usec ago)\n"
|
||||||
<< " Outbound Kbps: " << node->getOutboundKbps() << "\n"
|
<< " Outbound Kbps: " << node->getOutboundKbps() << "\n"
|
||||||
|
@ -458,6 +460,7 @@ qint64 LimitedNodeList::sendPacket(std::unique_ptr<NLPacket> packet, const HifiS
|
||||||
<< " Ping: " << node->getPingMs();
|
<< " Ping: " << node->getPingMs();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -497,6 +497,9 @@ private:
|
||||||
float _outboundKbps { 0.0f };
|
float _outboundKbps { 0.0f };
|
||||||
|
|
||||||
bool _dropOutgoingNodeTraffic { false };
|
bool _dropOutgoingNodeTraffic { false };
|
||||||
|
|
||||||
|
quint64 _sendErrorStatsTime { (quint64)0 };
|
||||||
|
static const quint64 ERROR_STATS_PERIOD_US { 2 * USECS_PER_SECOND };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_LimitedNodeList_h
|
#endif // hifi_LimitedNodeList_h
|
||||||
|
|
Loading…
Reference in a new issue