mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 22:00:31 +02:00
Record ACK data in stats
This commit is contained in:
parent
f163bbc0d5
commit
9475a31f1b
3 changed files with 16 additions and 3 deletions
|
@ -221,7 +221,7 @@ void Connection::sendACK() {
|
||||||
// have the socket send off our packet
|
// have the socket send off our packet
|
||||||
_parentSocket->writeBasePacket(*_ackPacket, _destination);
|
_parentSocket->writeBasePacket(*_ackPacket, _destination);
|
||||||
|
|
||||||
_stats.record(ConnectionStats::Stats::SentACK);
|
_stats.recordSentACK(_ackPacket->getWireSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
SequenceNumber Connection::nextACK() const {
|
SequenceNumber Connection::nextACK() const {
|
||||||
|
@ -327,7 +327,7 @@ void Connection::processACK(ControlPacketPointer controlPacket) {
|
||||||
controlPacket->readPrimitive(&ack);
|
controlPacket->readPrimitive(&ack);
|
||||||
|
|
||||||
// update the total count of received ACKs
|
// update the total count of received ACKs
|
||||||
_stats.record(ConnectionStats::Stats::ReceivedACK);
|
_stats.recordReceivedACK(controlPacket->getWireSize());
|
||||||
|
|
||||||
// validate that this isn't a BS ACK
|
// validate that this isn't a BS ACK
|
||||||
if (ack > getSendQueue().getCurrentSequenceNumber()) {
|
if (ack > getSendQueue().getCurrentSequenceNumber()) {
|
||||||
|
|
|
@ -36,6 +36,16 @@ void ConnectionStats::record(Stats::Event event) {
|
||||||
++_currentSample.events[(int) event];
|
++_currentSample.events[(int) event];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConnectionStats::recordSentACK(int size) {
|
||||||
|
record(Stats::SentACK);
|
||||||
|
recordSentPackets(0, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConnectionStats::recordReceivedACK(int size) {
|
||||||
|
record(Stats::ReceivedACK);
|
||||||
|
recordReceivedPackets(0, size);
|
||||||
|
}
|
||||||
|
|
||||||
void ConnectionStats::recordSentPackets(int payload, int total) {
|
void ConnectionStats::recordSentPackets(int payload, int total) {
|
||||||
++_currentSample.sentPackets;
|
++_currentSample.sentPackets;
|
||||||
_currentSample.sentUtilBytes += payload;
|
_currentSample.sentUtilBytes += payload;
|
||||||
|
|
|
@ -78,7 +78,10 @@ public:
|
||||||
Stats sample();
|
Stats sample();
|
||||||
|
|
||||||
void record(Stats::Event event);
|
void record(Stats::Event event);
|
||||||
|
|
||||||
|
void recordSentACK(int size);
|
||||||
|
void recordReceivedACK(int size);
|
||||||
|
|
||||||
void recordSentPackets(int payload, int total);
|
void recordSentPackets(int payload, int total);
|
||||||
void recordReceivedPackets(int payload, int total);
|
void recordReceivedPackets(int payload, int total);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue