-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
kind/enhancementImprovements to existing feature.Improvements to existing feature.
Description
Today when we report a metric the statsd client emits it immediately.
public func increment(by amount: Int64) {
self._increment(by: amount)
// https://github.com/b/statsd_spec#counters
// A counter is a gauge calculated at the server. Metrics sent by the client increment or decrement the value of the gauge rather than giving its current value.
// Counters may also have an associated sample rate, given as a decimal of the number of samples per event count. For example, a sample rate of 1/10 would be exported as 0.1.
// Valid counter values are in the range (-2^63^, 2^63^).
_ = self.client.emit(Metric(name: self.id, value: amount, type: .counter))
}
This can be overwhelmed easily when we hit counters from many many threads constantly, as each +1
will cause a metric send.
It may be better to debounce a metric a little bit before emitting it.
Metadata
Metadata
Assignees
Labels
kind/enhancementImprovements to existing feature.Improvements to existing feature.