Files
deb-python-kafka/kafka/metrics/stats/total.py
Zack Dever 64e9cebfa5 Kafka metrics java port. No reporters or instrumentation.
There is no straight translation for the JMX reporter into python,
so I'll do something else in a separate commit.
2016-04-13 17:26:38 -07:00

14 lines
378 B
Python

from kafka.metrics.measurable_stat import AbstractMeasurableStat
class Total(AbstractMeasurableStat):
"""An un-windowed cumulative total maintained over all time."""
def __init__(self, value=0.0):
self._total = value
def record(self, config, value, now):
self._total += value
def measure(self, config, now):
return float(self._total)