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

@@ -347,6 +347,8 @@ func (f *Interface) listenInBatch(reader io.ReadWriteCloser, batchReader BatchRe
conntrackCache := firewall.NewConntrackCacheTicker(f.conntrackCacheTimeout)
tunBatchHist := metrics.GetOrRegisterHistogram("batch.tun_read_size", nil, metrics.NewUniformSample(1024))
for {
n, err := batchReader.BatchRead(bufs, sizes)
if err != nil {
@@ -359,6 +361,8 @@ func (f *Interface) listenInBatch(reader io.ReadWriteCloser, batchReader BatchRe
os.Exit(2)
}
tunBatchHist.Update(int64(n))
// Process all packets in the batch at once
f.consumeInsidePackets(bufs, sizes, n, outs, i, conntrackCache.Get(f.l), &batchPackets, &batchAddrs)
}