stat.py 628 B

1234567891011121314151617181920212223
  1. from __future__ import absolute_import
  2. import abc
  3. class AbstractStat(object):
  4. """
  5. An AbstractStat is a quantity such as average, max, etc that is computed
  6. off the stream of updates to a sensor
  7. """
  8. __metaclass__ = abc.ABCMeta
  9. @abc.abstractmethod
  10. def record(self, config, value, time_ms):
  11. """
  12. Record the given value
  13. Arguments:
  14. config (MetricConfig): The configuration to use for this metric
  15. value (float): The value to record
  16. timeMs (int): The POSIX time in milliseconds this value occurred
  17. """
  18. raise NotImplementedError