Higher resolution forwarding latency histogram. (#4067)

* Higher resolution forwarding latency histogram.

Was using the average latency/jitter of last second to populate
forwarding latency/jitter histogram. But, it is too coarse, i. e. the
average value of latency/jitter is very low and those summarised samples
end up in the lowest bucket always.

A few things to address it
- record per packet forwarding latency in histogram
- adjust histogram bins to include smaller values
- Drop jitter histogram

This is a per packet call, but prometheus histogram is supposedly
fast/light weight. Would be good to get better resolution histograms.
Hence doing this. Please let me know if there are performance concerns.

* typo

* one more typo
This commit is contained in:
Raja Subramanian
2025-11-09 17:29:40 +05:30
committed by GitHub
parent 858db7ab7a
commit 4ce07bedeb
2 changed files with 18 additions and 14 deletions
+1
View File
@@ -49,6 +49,7 @@ func (s *ForwardStats) Update(arrival, left int64) (int64, bool) {
s.lastUpdateAt = arrival
s.lock.Unlock()
prometheus.RecordForwardLatencySample(transit)
return transit, isHighForwardingLatency
}