Files
geMoldInsight/venv/lib/python3.11/site-packages/kafka/metrics/stats/total.py
T
2026-02-12 23:27:48 +08:00

18 lines
446 B
Python

from __future__ import absolute_import
from kafka.metrics.measurable_stat import AbstractMeasurableStat
class Total(AbstractMeasurableStat):
"""An un-windowed cumulative total maintained over all time."""
__slots__ = ('_total')
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)