feat: 增加链路统计信息,两个链路分别显示在前端,D向A汇报D与B的信息

This commit is contained in:
Mock
2026-04-09 13:38:10 +08:00
parent e72f7f3fd9
commit 11e67282c7
19 changed files with 573 additions and 40 deletions

View File

@@ -298,6 +298,9 @@ ikcpcb *ikcp_create(IUINT32 conv, void *user)
kcp->fastlimit = IKCP_FASTACK_LIMIT;
kcp->nocwnd = 0;
kcp->xmit = 0;
kcp->timeout_retrans_total = 0;
kcp->fast_retrans_total = 0;
kcp->duplicate_recv_total = 0;
kcp->dead_link = IKCP_DEADLINK;
kcp->output = NULL;
kcp->writelog = NULL;
@@ -788,6 +791,7 @@ void ikcp_parse_data(ikcpcb *kcp, IKCPSEG *newseg)
}
else
{
kcp->duplicate_recv_total++;
ikcp_segment_delete(kcp, newseg);
}
@@ -1192,6 +1196,7 @@ void ikcp_flush(ikcpcb *kcp)
needsend = 1;
segment->xmit++;
kcp->xmit++;
kcp->timeout_retrans_total++;
if (kcp->nodelay == 0)
{
segment->rto += _imax_(segment->rto, (IUINT32)kcp->rx_rto);
@@ -1211,6 +1216,7 @@ void ikcp_flush(ikcpcb *kcp)
{
needsend = 1;
segment->xmit++;
kcp->fast_retrans_total++;
segment->fastack = 0;
segment->resendts = current + segment->rto;
change++;

View File

@@ -312,6 +312,9 @@ struct IKCPCB
IUINT32 *acklist;
IUINT32 ackcount;
IUINT32 ackblock;
IUINT64 timeout_retrans_total;
IUINT64 fast_retrans_total;
IUINT64 duplicate_recv_total;
void *user;
char *buffer;
int fastresend;