You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
418 B
15 lines
418 B
from __future__ import absolute_import
|
|
|
|
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)
|