diff options
author | Dana Powers <dana.powers@gmail.com> | 2016-07-10 21:41:23 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2016-07-16 14:05:50 -0700 |
commit | dbb0dae4f34a469bf04a4df751892b237b4707a9 (patch) | |
tree | 868fa6c002a4c0b3820bd51e2bd7964226e20fc5 | |
parent | 9b5c5acd9a8ba044c90ce3583c6c5231369627d6 (diff) | |
download | kafka-python-dbb0dae4f34a469bf04a4df751892b237b4707a9.tar.gz |
Update Sensor time_ms docs; only calculate if needed
-rw-r--r-- | kafka/metrics/stats/sensor.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kafka/metrics/stats/sensor.py b/kafka/metrics/stats/sensor.py index b0bf4db..72bacfc 100644 --- a/kafka/metrics/stats/sensor.py +++ b/kafka/metrics/stats/sensor.py @@ -55,15 +55,15 @@ class Sensor(object): Record a value at a known time. Arguments: value (double): The value we are recording - time_ms (int): The current POSIX time in milliseconds + time_ms (int): A POSIX timestamp in milliseconds. + Default: The time when record() is evaluated (now) Raises: QuotaViolationException: if recording this value moves a metric beyond its configured maximum or minimum bound """ - now = time.time() * 1000 if time_ms is None: - time_ms = now + time_ms = time.time() * 1000 self._last_record_time = time_ms with self._lock: # XXX high volume, might be performance issue # increment all the stats |