track.aggregators package

Submodules

track.aggregators.aggregator module

class track.aggregators.aggregator.Aggregator[source]

Bases: object

Attributes:
val

Return the last observed value

Methods

lazy(aggregator_t, \*\*kwargs) Lazily instantiate the underlying aggregator
append  
to_json  
append(self, other)[source]
static lazy(aggregator_t, **kwargs)[source]

Lazily instantiate the underlying aggregator

to_json(self, short=False)[source]
val

Return the last observed value

class track.aggregators.aggregator.RingAggregator(n, dtype='f')[source]

Bases: track.aggregators.aggregator.Aggregator

Saves the n last elements. Start overriding the elements once n elements is reached

Attributes:
val

Return the last observed value

Methods

lazy(n, dtype) Lazily instantiate the underlying aggregator
append  
to_json  
append(self, other)[source]
static lazy(n, dtype)[source]

Lazily instantiate the underlying aggregator

to_json(self, short=False)[source]
val

Return the last observed value

class track.aggregators.aggregator.StatAggregator(skip_obs=10)[source]

Bases: track.aggregators.aggregator.Aggregator

Compute mean, sd, min, max; does not keep the entire history. This is useful if you are worried about memory usage and the values should not vary much. i.e keeping the entire history is not useful.

Attributes:
avg
max
min
sd
sum
total
val

Return the last observed value

Methods

lazy(skip) Lazily instantiate the underlying aggregator
append  
from_json  
to_json  
append(self, other)[source]
avg
static from_json(data)[source]
static lazy(skip)[source]

Lazily instantiate the underlying aggregator

max
min
sd
sum
to_json(self, short=False)[source]
total
val

Return the last observed value

class track.aggregators.aggregator.TimeSeriesAggregator[source]

Bases: track.aggregators.aggregator.Aggregator

Keeps the entire history of the metric

Attributes:
val

Return the last observed value

Methods

lazy() Lazily instantiate the underlying aggregator
append  
to_json  
append(self, other)[source]
static lazy()[source]

Lazily instantiate the underlying aggregator

to_json(self, short=False)[source]
val

Return the last observed value

class track.aggregators.aggregator.ValueAggregator(val=None)[source]

Bases: track.aggregators.aggregator.Aggregator

Does not Aggregate only keeps the latest value

Attributes:
val

Return the last observed value

Methods

lazy() Lazily instantiate the underlying aggregator
append  
to_json  
append(self, other)[source]
static lazy()[source]

Lazily instantiate the underlying aggregator

to_json(self, short=False)[source]
val

Return the last observed value

Module contents