hots.core.instance

HOTS core functionality: manage state and data ingestion.

class hots.core.instance.FieldNames(tick: str, host: str, individual: str)[source]

Bases: object

Column names used across the project.

host: str
individual: str
tick: str
class hots.core.instance.Instance(config: AppConfig)[source]

Bases: object

Maintain application state, including data, Kafka, and metrics.

static clear_kafka_topics() None[source]

Clear all configured Kafka topics.

get_id_map() dict[Any, int][source]

Get a mapping from container IDs to integer indices.

The mapping is cached and invalidated when update_data() appends new rows.

get_inv_id_map() dict[int, Any][source]

Get the inverse mapping from indices to container IDs (cached).

get_working_df(tmin, tmax, inclusive=True)[source]

Get data for the current time window.

update_data(new_df_indiv: DataFrame) None[source]

Update the dataframes with newly ingested individual-level data.