Skip to content

Commit

Permalink
Added histogram metric type
Browse files Browse the repository at this point in the history
The statsd client now has a histogram metric type which mimics the
Datadog metric type.
  • Loading branch information
mchlwellman committed Nov 21, 2024
1 parent 979cbb6 commit 1ba0d18
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions notifications_utils/clients/statsd/statsd_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def gauge(self, stat, count):
if self.active:
self.statsd_client.gauge(self.format_stat_name(stat), count)

def histogram(self, stat, value, rate=1):
"""Increment a stat by `histogram`."""
self.statsd_client._send_stat(stat, '%s|h' % value, rate)

def timing(self, stat, delta, rate=1):
if self.active:
self.statsd_client.timing(self.format_stat_name(stat), delta, rate)
Expand Down

0 comments on commit 1ba0d18

Please sign in to comment.