INNER CODE UNIT · Python
counter
DataDog/dd-agent · checks/__init__.py:115
def counter(self, metric):
"""
Treats the metric as a counter, i.e. computes its per second derivative
ACHTUNG: Resets previous values associated with this metric.
"""
self._counters[metric] = True
self._sample_store[metric] = {}
def is_counter(self, metric):
"Is this metric a counter?"
return metric in self._counters
def gauge(self, metric):
"""
Treats the metric as a gauge, i.e. keep the data as is
ACHTUNG: Resets previous values associated with this metric.
"""
self._sample_store[metric] = {}