whylogs.core.statistics.datatypes.integertracker

Module Contents

Classes

IntTracker

Track statistics for integers

class whylogs.core.statistics.datatypes.integertracker.IntTracker(min: int = None, max: int = None, sum: int = None, count: int = None)

Track statistics for integers

Parameters
  • min – Current min value

  • max – Current max value

  • sum – Sum of the numbers

  • count – Total count of numbers

DEFAULTS
set_defaults(self)

Set attribute values to defaults

mean(self)

Calculate the current mean. Returns None if self.count = 0

update(self, value)

Add a number to the tracking statistics

merge(self, other)

Merge values of another IntTracker with this one.

Parameters

other (IntTracker) – Other tracker

Returns

new – New, merged tracker

Return type

IntTracker

to_protobuf(self)

Return the object serialized as a protobuf message

Returns

message

Return type

LongsMessage

static from_protobuf(message)

Load from a protobuf message

Returns

number_tracker

Return type

IntTracker