From 1ba0d182c197c5992fd187d377c9be7695e5cd01 Mon Sep 17 00:00:00 2001 From: Michael Wellman Date: Thu, 21 Nov 2024 09:52:58 -0500 Subject: [PATCH] Added histogram metric type The statsd client now has a histogram metric type which mimics the Datadog metric type. --- notifications_utils/clients/statsd/statsd_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/notifications_utils/clients/statsd/statsd_client.py b/notifications_utils/clients/statsd/statsd_client.py index a2fdb502..6b74d569 100644 --- a/notifications_utils/clients/statsd/statsd_client.py +++ b/notifications_utils/clients/statsd/statsd_client.py @@ -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)