Skip to content

Commit

Permalink
API-2079 Histogram metric type docstring (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
mchlwellman authored Nov 22, 2024
1 parent 8cd286d commit 5ab78d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions notifications_utils/clients/statsd/statsd_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ def gauge(self, stat, count):
self.statsd_client.gauge(self.format_stat_name(stat), count)

def histogram(self, stat, value, rate=1):
"""This is a DataDog specific method, which sends a histogram value to statsd. A statsd packet
is a packet with this format - <metric_name>:<value>|<type>|@<sample_rate>.
"""Histogram is a DataDog specific metric type, which we've added here to our statsd client. StatsD packets
are strings with this format - <metric_name>:<value>|<type>|@<sample_rate>.
For a histogram, the metric type is 'h'.
reference: https://github.com/DataDog/datadogpy/blob/master/datadog/dogstatsd/base.py#L950
statsd _send_stat reference: https://github.com/jsocol/pystatsd/blob/master/statsd/client/base.py#L60
dogstasd histogram reference: https://github.com/DataDog/datadogpy/blob/master/datadog/dogstatsd/base.py#L950
"""
if self.active:
self.statsd_client._send_stat(self.format_stat_name(stat), '%s|h' % value, rate)
Expand Down
2 changes: 1 addition & 1 deletion notifications_utils/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.2.4'
__version__ = '2.2.5'

0 comments on commit 5ab78d9

Please sign in to comment.