m2m模型翻译
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

7 months ago
  1. from __future__ import absolute_import
  2. from kafka.metrics.measurable_stat import AbstractMeasurableStat
  3. class Total(AbstractMeasurableStat):
  4. """An un-windowed cumulative total maintained over all time."""
  5. def __init__(self, value=0.0):
  6. self._total = value
  7. def record(self, config, value, now):
  8. self._total += value
  9. def measure(self, config, now):
  10. return float(self._total)