Debian Codegraph @

cmd/atomdns/internal/dnsmetrics/metrics.go

raw
1 package dnsmetrics
2
3 // Should returns true when we should gather a metric. This is done every N times. If N isn't 0 (no metrics),
4 // i is incremented.
5 func Should(i *uint64, N uint64) bool {
6 if N == 0 {
7 return false
8 }
9 ok := *i%N == 0
10 *i++
11 return ok
12 }