mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:23:36 +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
|
||||
_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()) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue