Utility & logging helpers

HOTS preprocessing tools.

hots.utils.tools.build_df_from_containers(df_indiv: DataFrame, tick_field: str, host_field: str, metrics: list[str]) DataFrame[source]

Aggregate individual consumption into host-level time-series. Ensures each host has an entry for every tick (filling missing values with zeros).

hots.utils.tools.check_missing_entries_df(df: DataFrame, tick_field: str, indiv_field: str, host_field: str, metrics: list[str]) DataFrame[source]

Ensure all (timestamp, container) pairs exist and fill missing data.

hots.utils.tools.slice_by_time(df, col, tmin, tmax)[source]

Get data between tmin and tmax in df.

HOTS logging configuration.

hots.utils.logging_config.setup_logging(level: str, filename: str | None, fmt: str, add_console: bool = False, reset_file: bool = True) None[source]

Initialize Python root logger with a fresh file per run when reset_file=True.

HOTS signal handling utilities.

hots.utils.signals.setup_signal_handlers(shutdown_fn)[source]

Register SIGINT and SIGTERM to the given shutdown function.