Skip to content

Commit

Permalink
[core] Fixed stats counting packets dropped by a group.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Apr 19, 2024
1 parent cf13200 commit 98f48e3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions srtcore/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2309,6 +2309,15 @@ int CUDTGroup::recv(char* buf, int len, SRT_MSGCTRL& w_mc)
}
fillGroupData((w_mc), w_mc);

const int32_t iNumDropped = (CSeqNo(w_mc.pktseq) - CSeqNo(m_RcvBaseSeqNo)) - 1;
if (iNumDropped > 0)
{
m_stats.recvDrop.count(stats::BytesPackets(iNumDropped * static_cast<uint64_t>(avgRcvPacketSize()), iNumDropped));
LOGC(grlog.Warn,
log << "@" << m_GroupID << " GROUP RCV-DROPPED " << iNumDropped << " packet(s): seqno %"
<< m_RcvBaseSeqNo << " to %" << w_mc.pktseq);
}

HLOGC(grlog.Debug,
log << "grp/recv: $" << id() << ": Update m_RcvBaseSeqNo: %" << m_RcvBaseSeqNo << " -> %" << w_mc.pktseq);
m_RcvBaseSeqNo = w_mc.pktseq;
Expand Down

0 comments on commit 98f48e3

Please sign in to comment.