diff --git a/libraries/networking/src/udt/Connection.cpp b/libraries/networking/src/udt/Connection.cpp index 317c5e6255..2d5ac0218f 100644 --- a/libraries/networking/src/udt/Connection.cpp +++ b/libraries/networking/src/udt/Connection.cpp @@ -221,7 +221,7 @@ void Connection::sendACK() { // have the socket send off our packet _parentSocket->writeBasePacket(*_ackPacket, _destination); - _stats.record(ConnectionStats::Stats::SentACK); + _stats.recordSentACK(_ackPacket->getWireSize()); } SequenceNumber Connection::nextACK() const { @@ -327,7 +327,7 @@ void Connection::processACK(ControlPacketPointer controlPacket) { controlPacket->readPrimitive(&ack); // update the total count of received ACKs - _stats.record(ConnectionStats::Stats::ReceivedACK); + _stats.recordReceivedACK(controlPacket->getWireSize()); // validate that this isn't a BS ACK if (ack > getSendQueue().getCurrentSequenceNumber()) { diff --git a/libraries/networking/src/udt/ConnectionStats.cpp b/libraries/networking/src/udt/ConnectionStats.cpp index 4f0722edd3..188cc3114d 100644 --- a/libraries/networking/src/udt/ConnectionStats.cpp +++ b/libraries/networking/src/udt/ConnectionStats.cpp @@ -36,6 +36,16 @@ void ConnectionStats::record(Stats::Event 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) { ++_currentSample.sentPackets; _currentSample.sentUtilBytes += payload; diff --git a/libraries/networking/src/udt/ConnectionStats.h b/libraries/networking/src/udt/ConnectionStats.h index b7350d4341..8ff0ec90fd 100644 --- a/libraries/networking/src/udt/ConnectionStats.h +++ b/libraries/networking/src/udt/ConnectionStats.h @@ -78,7 +78,10 @@ public: Stats sample(); void record(Stats::Event event); - + + void recordSentACK(int size); + void recordReceivedACK(int size); + void recordSentPackets(int payload, int total); void recordReceivedPackets(int payload, int total);