mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-22 16:34:25 +01:00
don't register metrics in loops
This commit is contained in:
@@ -3,7 +3,6 @@ package nebula
|
||||
import (
|
||||
"net/netip"
|
||||
|
||||
"github.com/rcrowley/go-metrics"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/slackhq/nebula/firewall"
|
||||
"github.com/slackhq/nebula/header"
|
||||
@@ -146,7 +145,7 @@ func (f *Interface) consumeInsidePackets(packets [][]byte, sizes []int, count in
|
||||
// Send all accumulated packets in one batch
|
||||
if len(*batchPackets) > 0 {
|
||||
batchSize := len(*batchPackets)
|
||||
metrics.GetOrRegisterHistogram("batch.udp_write_size", nil, metrics.NewUniformSample(1024)).Update(int64(batchSize))
|
||||
f.batchMetrics.udpWriteSize.Update(int64(batchSize))
|
||||
|
||||
n, err := f.writers[q].WriteMulti(*batchPackets, *batchAddrs)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user