whylogs.api.logger.experimental.logger.actor.time_util
#
Module Contents#
Classes#
Generic enumeration. |
|
A timer that executes a function repeatedly given a Schedule. It will execute at the bottom of |
Functions#
|
|
|
- class whylogs.api.logger.experimental.logger.actor.time_util.TimeGranularity#
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- Second = 'Second'#
- Minute = 'Minute'#
- Hour = 'Hour'#
- Day = 'Day'#
- Month = 'Month'#
- Year = 'Year'#
- name()#
The name of the Enum member.
- value()#
The value of the Enum member.
- whylogs.api.logger.experimental.logger.actor.time_util.truncate_time_ms(t: int, granularity: TimeGranularity) int #
- Parameters
t (int) –
granularity (TimeGranularity) –
- Return type
- class whylogs.api.logger.experimental.logger.actor.time_util.Schedule#
- cadence: TimeGranularity#
- class whylogs.api.logger.experimental.logger.actor.time_util.FunctionTimer(schedule: Schedule, fn: Callable[[], Any], timer_class: Type[Any] = Timer)#
A timer that executes a function repeatedly given a Schedule. It will execute at the bottom of that time period. For example, a schedule of Schedule(TimeGranularity.Hour, 1) will execute at the start of each hour. If you start the timer 5 minutes before the next hour then it will first execute in five minutes, and then each hour after that.
- Parameters
schedule (Schedule) –
fn (Callable[[], Any]) –
timer_class (Type[Any]) –