From 4c778c58f6aa686e44f14e5ac18638a116be5dda Mon Sep 17 00:00:00 2001 From: Felicitas Pojtinger Date: Sun, 15 May 2022 17:09:57 +0200 Subject: [PATCH] feat: Add better debugging support for low-throughput connections in throughput test (closes #3) --- pkg/wrtcthr/wrtcthr.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/wrtcthr/wrtcthr.go b/pkg/wrtcthr/wrtcthr.go index d6876f6..ac566b3 100644 --- a/pkg/wrtcthr/wrtcthr.go +++ b/pkg/wrtcthr/wrtcthr.go @@ -172,6 +172,13 @@ func (a *Adapter) Wait() error { for { read := 0 for i := 0; i < a.config.PacketCount; i++ { + if i == 0 { + log.Debug(). + Str("channelID", peer.ChannelID). + Str("peerID", peer.PeerID). + Msg("Started receiving data") + } + buf := make([]byte, a.config.PacketLength) n, err := peer.Conn.Read(buf) @@ -188,6 +195,11 @@ func (a *Adapter) Wait() error { read += n } + log.Debug(). + Str("channelID", peer.ChannelID). + Str("peerID", peer.PeerID). + Msg("Acknowledging received data") + if _, err := peer.Conn.Write(make([]byte, acklen)); err != nil { log.Debug(). Err(err).