instruments

This commit is contained in:
Jay Wren
2025-11-14 14:43:51 -05:00
parent a62ffca975
commit 7c3708561d
4 changed files with 14 additions and 1 deletions

View File

@@ -151,6 +151,8 @@ func (u *StdConn) ListenOut(r EncReader) {
read = u.ReadSingle
}
udpBatchHist := metrics.GetOrRegisterHistogram("batch.udp_read_size", nil, metrics.NewUniformSample(1024))
for {
n, err := read(msgs)
if err != nil {
@@ -158,6 +160,8 @@ func (u *StdConn) ListenOut(r EncReader) {
return
}
udpBatchHist.Update(int64(n))
for i := 0; i < n; i++ {
// Its ok to skip the ok check here, the slicing is the only error that can occur and it will panic
if u.isV4 {