mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-07 20:34:32 +02:00
Record more detailed stats on Retransmit/duplicate
This commit is contained in:
parent
aeafb3c9a7
commit
c5b60594b6
9 changed files with 60 additions and 27 deletions
|
@ -945,14 +945,14 @@ void AssetServer::sendStatsPacket() {
|
|||
upstreamStats["2. Sent Packets"] = stat.second.sentPackets;
|
||||
upstreamStats["3. Recvd ACK"] = events[Events::ReceivedACK];
|
||||
upstreamStats["4. Procd ACK"] = events[Events::ProcessedACK];
|
||||
upstreamStats["5. Retransmitted"] = events[Events::Retransmission];
|
||||
upstreamStats["5. Retransmitted"] = stat.second.retransmittedPackets;
|
||||
nodeStats["Upstream Stats"] = upstreamStats;
|
||||
|
||||
QJsonObject downstreamStats;
|
||||
downstreamStats["1. Recvd (P/s)"] = stat.second.receiveRate;
|
||||
downstreamStats["2. Recvd Packets"] = stat.second.receivedPackets;
|
||||
downstreamStats["3. Sent ACK"] = events[Events::SentACK];
|
||||
downstreamStats["4. Duplicates"] = events[Events::Duplicate];
|
||||
downstreamStats["4. Duplicates"] = stat.second.duplicatePackets;
|
||||
nodeStats["Downstream Stats"] = downstreamStats;
|
||||
|
||||
QString uuid;
|
||||
|
|
|
@ -372,8 +372,6 @@ protected:
|
|||
|
||||
qint64 sendPacket(std::unique_ptr<NLPacket> packet, const Node& destinationNode,
|
||||
const HifiSockAddr& overridenSockAddr);
|
||||
qint64 writePacket(const NLPacket& packet, const HifiSockAddr& destinationSockAddr,
|
||||
const QUuid& connectionSecret = QUuid());
|
||||
void collectPacketStats(const NLPacket& packet);
|
||||
void fillPacketHeader(const NLPacket& packet, HMACAuth* hmacAuth = nullptr);
|
||||
|
||||
|
|
|
@ -192,8 +192,9 @@ void Connection::recordSentPackets(int wireSize, int payloadSize,
|
|||
_congestionControl->onPacketSent(wireSize, seqNum, timePoint);
|
||||
}
|
||||
|
||||
void Connection::recordRetransmission(int wireSize, SequenceNumber seqNum, p_high_resolution_clock::time_point timePoint) {
|
||||
_stats.record(ConnectionStats::Stats::Retransmission);
|
||||
void Connection::recordRetransmission(int wireSize, int payloadSize,
|
||||
SequenceNumber seqNum, p_high_resolution_clock::time_point timePoint) {
|
||||
_stats.recordRetransmittedPackets(payloadSize, wireSize);
|
||||
|
||||
_congestionControl->onPacketReSent(wireSize, seqNum, timePoint);
|
||||
}
|
||||
|
@ -270,7 +271,7 @@ bool Connection::processReceivedSequenceNumber(SequenceNumber sequenceNumber, in
|
|||
sendACK();
|
||||
|
||||
if (wasDuplicate) {
|
||||
_stats.record(ConnectionStats::Stats::Duplicate);
|
||||
_stats.recordDuplicatePackets(payloadSize, packetSize);
|
||||
} else {
|
||||
_stats.recordReceivedPackets(payloadSize, packetSize);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ signals:
|
|||
|
||||
private slots:
|
||||
void recordSentPackets(int wireSize, int payloadSize, SequenceNumber seqNum, p_high_resolution_clock::time_point timePoint);
|
||||
void recordRetransmission(int wireSize, SequenceNumber sequenceNumber, p_high_resolution_clock::time_point timePoint);
|
||||
void recordRetransmission(int wireSize, int payloadSize, SequenceNumber sequenceNumber, p_high_resolution_clock::time_point timePoint);
|
||||
void queueInactive();
|
||||
void queueTimeout();
|
||||
|
||||
|
|
|
@ -60,6 +60,28 @@ void ConnectionStats::recordReceivedPackets(int payload, int total) {
|
|||
_total.receivedBytes += total;
|
||||
}
|
||||
|
||||
void ConnectionStats::recordRetransmittedPackets(int payload, int total) {
|
||||
++_currentSample.retransmittedPackets;
|
||||
++_total.retransmittedPackets;
|
||||
|
||||
_currentSample.retransmittedUtilBytes += payload;
|
||||
_total.retransmittedUtilBytes += payload;
|
||||
|
||||
_currentSample.retransmittedBytes += total;
|
||||
_total.retransmittedBytes += total;
|
||||
}
|
||||
|
||||
void ConnectionStats::recordDuplicatePackets(int payload, int total) {
|
||||
++_currentSample.duplicatePackets;
|
||||
++_total.duplicatePackets;
|
||||
|
||||
_currentSample.duplicateUtilBytes += payload;
|
||||
_total.duplicateUtilBytes += payload;
|
||||
|
||||
_currentSample.duplicateBytes += total;
|
||||
_total.duplicateBytes += total;
|
||||
}
|
||||
|
||||
void ConnectionStats::recordUnreliableSentPackets(int payload, int total) {
|
||||
++_currentSample.sentUnreliablePackets;
|
||||
++_total.sentUnreliablePackets;
|
||||
|
@ -117,13 +139,13 @@ QDebug& operator<<(QDebug&& debug, const udt::ConnectionStats::Stats& stats) {
|
|||
HIFI_LOG_EVENT(SentACK)
|
||||
HIFI_LOG_EVENT(ReceivedACK)
|
||||
HIFI_LOG_EVENT(ProcessedACK)
|
||||
HIFI_LOG_EVENT(Retransmission)
|
||||
HIFI_LOG_EVENT(Duplicate)
|
||||
;
|
||||
#undef HIFI_LOG_EVENT
|
||||
|
||||
debug << " Sent packets: " << stats.sentPackets;
|
||||
debug << "\n Retransmitted packets: " << stats.retransmittedPackets;
|
||||
debug << "\n Received packets: " << stats.receivedPackets;
|
||||
debug << "\n Duplicate packets: " << stats.duplicatePackets;
|
||||
debug << "\n Sent util bytes: " << stats.sentUtilBytes;
|
||||
debug << "\n Sent bytes: " << stats.sentBytes;
|
||||
debug << "\n Received bytes: " << stats.receivedBytes << "\n";
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <chrono>
|
||||
#include <array>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace udt {
|
||||
|
||||
|
@ -24,8 +25,6 @@ public:
|
|||
SentACK,
|
||||
ReceivedACK,
|
||||
ProcessedACK,
|
||||
Retransmission,
|
||||
Duplicate,
|
||||
|
||||
NumEvents
|
||||
};
|
||||
|
@ -40,19 +39,27 @@ public:
|
|||
Events events;
|
||||
|
||||
// packet counts and sizes
|
||||
int sentPackets { 0 };
|
||||
int receivedPackets { 0 };
|
||||
int sentUtilBytes { 0 };
|
||||
int receivedUtilBytes { 0 };
|
||||
int sentBytes { 0 };
|
||||
int receivedBytes { 0 };
|
||||
uint32_t sentPackets { 0 };
|
||||
uint32_t receivedPackets { 0 };
|
||||
uint32_t retransmittedPackets { 0 };
|
||||
uint32_t duplicatePackets { 0 };
|
||||
|
||||
uint64_t sentUtilBytes { 0 };
|
||||
uint64_t receivedUtilBytes { 0 };
|
||||
uint64_t retransmittedUtilBytes { 0 };
|
||||
uint64_t duplicateUtilBytes { 0 };
|
||||
|
||||
uint64_t sentBytes { 0 };
|
||||
uint64_t receivedBytes { 0 };
|
||||
uint64_t retransmittedBytes { 0 };
|
||||
uint64_t duplicateBytes { 0 };
|
||||
|
||||
int sentUnreliablePackets { 0 };
|
||||
int receivedUnreliablePackets { 0 };
|
||||
int sentUnreliableUtilBytes { 0 };
|
||||
int receivedUnreliableUtilBytes { 0 };
|
||||
int sentUnreliableBytes { 0 };
|
||||
int receivedUnreliableBytes { 0 };
|
||||
uint32_t sentUnreliablePackets { 0 };
|
||||
uint32_t receivedUnreliablePackets { 0 };
|
||||
uint64_t sentUnreliableUtilBytes { 0 };
|
||||
uint64_t receivedUnreliableUtilBytes { 0 };
|
||||
uint64_t sentUnreliableBytes { 0 };
|
||||
uint64_t receivedUnreliableBytes { 0 };
|
||||
|
||||
// the following stats are trailing averages in the result, not totals
|
||||
int sendRate { 0 };
|
||||
|
@ -75,6 +82,9 @@ public:
|
|||
|
||||
void recordSentPackets(int payload, int total);
|
||||
void recordReceivedPackets(int payload, int total);
|
||||
|
||||
void recordRetransmittedPackets(int payload, int total);
|
||||
void recordDuplicatePackets(int payload, int total);
|
||||
|
||||
void recordUnreliableSentPackets(int payload, int total);
|
||||
void recordUnreliableReceivedPackets(int payload, int total);
|
||||
|
|
|
@ -404,6 +404,7 @@ bool SendQueue::maybeResendPacket() {
|
|||
Packet::ObfuscationLevel level = (Packet::ObfuscationLevel)(entry.first < 2 ? 0 : (entry.first - 2) % 4);
|
||||
|
||||
auto wireSize = resendPacket.getWireSize();
|
||||
auto payloadSize = resendPacket.getPayloadSize();
|
||||
auto sequenceNumber = it->first;
|
||||
|
||||
if (level != Packet::NoObfuscation) {
|
||||
|
@ -439,7 +440,8 @@ bool SendQueue::maybeResendPacket() {
|
|||
sentLocker.unlock();
|
||||
}
|
||||
|
||||
emit packetRetransmitted(wireSize, sequenceNumber, p_high_resolution_clock::now());
|
||||
emit packetRetransmitted(wireSize, payloadSize, sequenceNumber,
|
||||
p_high_resolution_clock::now());
|
||||
|
||||
// Signal that we did resend a packet
|
||||
return true;
|
||||
|
|
|
@ -78,7 +78,7 @@ public slots:
|
|||
|
||||
signals:
|
||||
void packetSent(int wireSize, int payloadSize, SequenceNumber seqNum, p_high_resolution_clock::time_point timePoint);
|
||||
void packetRetransmitted(int wireSize, SequenceNumber seqNum, p_high_resolution_clock::time_point timePoint);
|
||||
void packetRetransmitted(int wireSize, int payloadSize, SequenceNumber seqNum, p_high_resolution_clock::time_point timePoint);
|
||||
|
||||
void queueInactive();
|
||||
|
||||
|
|
|
@ -386,7 +386,7 @@ void UDTTest::sampleStats() {
|
|||
QString::number(stats.events[udt::ConnectionStats::Stats::ReceivedACK]).rightJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size()),
|
||||
QString::number(stats.events[udt::ConnectionStats::Stats::ProcessedACK]).rightJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size()),
|
||||
QString::number(stats.sentPackets).rightJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size()),
|
||||
QString::number(stats.events[udt::ConnectionStats::Stats::Retransmission]).rightJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size())
|
||||
QString::number(stats.retransmittedPackets).rightJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size())
|
||||
};
|
||||
|
||||
// output this line of values
|
||||
|
|
Loading…
Reference in a new issue