summaryrefslogtreecommitdiff
path: root/kafka/metrics/stat.py
diff options
context:
space:
mode:
authorZack Dever <zackdever@gmail.com>2016-04-14 11:02:01 -0700
committerZack Dever <zackdever@gmail.com>2016-04-14 11:02:01 -0700
commitcf679ae387519f658f17b2da2d05ff84834cb1f5 (patch)
tree5618627ab6919b6fd4cd476e801c0f9bf449d716 /kafka/metrics/stat.py
parent0c94b83a2dff8113b5fd7c16df8a11ca03c4377b (diff)
parente2b340c4408801515f5e924aec066af983aa5c57 (diff)
downloadkafka-python-cf679ae387519f658f17b2da2d05ff84834cb1f5.tar.gz
Merge pull request #637 from zackdever/metrics
Metrics java port
Diffstat (limited to 'kafka/metrics/stat.py')
-rw-r--r--kafka/metrics/stat.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/kafka/metrics/stat.py b/kafka/metrics/stat.py
new file mode 100644
index 0000000..c10f3ce
--- /dev/null
+++ b/kafka/metrics/stat.py
@@ -0,0 +1,21 @@
+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