Skip to content

Commit 80a966a

Browse files
Chen Dongcdong8812
authored andcommitted
add an option to manually set value sent to StatsD instead of using the difference by default
1 parent 1ff8099 commit 80a966a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/diamond/handler/stats_d.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ def _send(self):
132132
value = metric.raw_value
133133
if metric.path in self.old_values:
134134
value = value - self.old_values[metric.path]
135+
# provide an option for caller to manually set the value
136+
elif metric.value:
137+
value = metric.value
135138
self.old_values[metric.path] = metric.raw_value
136139

137140
if hasattr(statsd, 'StatsClient'):

0 commit comments

Comments
 (0)