File: stat.py

package info (click to toggle)
python-kafka 2.0.2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,740 kB
  • sloc: python: 20,457; makefile: 210; sh: 76
file content (23 lines) | stat: -rw-r--r-- 628 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from __future__ import absolute_import

import abc


class AbstractStat(object):
    """
    An AbstractStat is a quantity such as average, max, etc that is computed
    off the stream of updates to a sensor
    """
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def record(self, config, value, time_ms):
        """
        Record the given value

        Arguments:
            config (MetricConfig): The configuration to use for this metric
            value (float): The value to record
            timeMs (int): The POSIX time in milliseconds this value occurred
        """
        raise NotImplementedError