This commit is contained in:
@@ -37,6 +37,8 @@ class Rate(AbstractMeasurableStat):
|
||||
occurrences (e.g. the count of values measured over the time interval)
|
||||
or other such values.
|
||||
"""
|
||||
__slots__ = ('_stat', '_unit')
|
||||
|
||||
def __init__(self, time_unit=TimeUnit.SECONDS, sampled_stat=None):
|
||||
self._stat = sampled_stat or SampledTotal()
|
||||
self._unit = time_unit
|
||||
@@ -105,6 +107,7 @@ class Rate(AbstractMeasurableStat):
|
||||
|
||||
|
||||
class SampledTotal(AbstractSampledStat):
|
||||
__slots__ = ('_initial_value', '_samples', '_current')
|
||||
def __init__(self, initial_value=None):
|
||||
if initial_value is not None:
|
||||
raise ValueError('initial_value cannot be set on SampledTotal')
|
||||
|
||||
Reference in New Issue
Block a user