This commit tracks a few simple statistics around the performance of the
BatchedUDPSink:
number of batches sent
number of synchronous sends, due to the buffer being full
average length of batched packets
average number of statsd lines in batched packets
average number of statsd lines in the buffer (measured at the
beginning of a batch)
We add a new option STATSD_BATCH_STATISTICS_INTERVAL (default: 0),
which when set to any non-zero value, will track and flush statistics at
that same interval.
To do this, we need to use a mutex for synchronization. Local benchmarks
indicate that the performance impact is minimal, if not non-existent:
Of course, we are doing more work when the option is enabled, so
technically there must be some impact to it. However, at least in
local micro-benchmarks, it certainly seems acceptable.
We ran this for a bit in production, and everything looks correct and nothing imploded. I'm going to merge it; we may want to add additional stats in the future though.
This commit tracks a few simple statistics around the performance of the BatchedUDPSink:
We add a new option
STATSD_BATCH_STATISTICS_INTERVAL
(default: 0), which when set to any non-zero value, will track and flush statistics at that same interval.To do this, we need to use a mutex for synchronization. Local benchmarks indicate that the performance impact is minimal, if not non-existent:
Of course, we are doing more work when the option is enabled, so technically there must be some impact to it. However, at least in local micro-benchmarks, it certainly seems acceptable.