Skip to content

tdfs4ds.serve.execution_log

tdfs4ds.serve.execution_log

Execution log of the admin app: each process execution with its resource use (0.3.3.19).

Same three layers as doc_coverage / efs_map:

  • :func:collect_execution_log - the only I/O: the executions in a window (:func:tdfs4ds.utils.execution_resources.read_execution_resources: the stored history + the live follow-up <-> DBQL join) and the process catalog.
  • :func:build_execution_model - pure: rows ready for the page, per-process and per-version statistics, key figures, the states to state.
  • the page itself is drawn by app.js (renderRuns).

Vocabulary: an execution is one follow-up row (one FilterManager segment or one TimeManager date); a run groups the executions of one call (:func:tdfs4ds.process_store.process_followup.execution_run_ids) and is what "how often" is measured on. Primary store only.

MAX_ROWS module-attribute

MAX_ROWS = 2000

STATE_TEXT module-attribute

STATE_TEXT = {STATE_OK: '', STATE_NO_HISTORY: 'The history tables (FS_EXECUTION_RESOURCES) are not installed on this store: only what DBQL still holds is shown. Run connect() as a user who may create tables in the feature store database to keep it.', STATE_HISTORY_OFF: 'The execution history is switched off: only what DBQL still holds is shown. Switch it on in Parameters (Execution log: query band and history).', STATE_DBQL_UNREADABLE: 'DBQL cannot be read: runs are listed from the follow-up table, without their resource use.', STATE_NOT_LOGGED: 'No execution of this window is in DBQL: query logging looks off, or the runs predate the query band (tdfs4ds 0.3.1.222).'}

DBQL_STATUS_TEXT module-attribute

DBQL_STATUS_TEXT = {'STORED': 'kept in the history', 'LOGGED': 'in DBQL', 'PARTIAL': 'in DBQL, still being written', 'PENDING': 'not in DBQL yet (written every 10 minutes)', 'NOT LOGGED': 'not in DBQL (logging off, or before the query band)', 'UNAVAILABLE': 'DBQL not readable'}

_clean

_clean(v)

JSON-safe scalar: NaN/NaT -> None, timestamps -> 'YYYY-MM-DD HH:MM:SS'.

_ts_text

_ts_text(v) -> str

_process_names

_process_names() -> dict

{PROCESS_ID: {"view", "domain", "removed"}}: the current process catalog, plus the processes removed since (their runs stay in the history), named from the catalog's past rows.

collect_execution_log

collect_execution_log(days: int = 30, process_ids=None, as_of=None) -> dict

Executions of the window (as_of - days, as_of] and the process names.

_label

_label(pid: str, names: dict) -> str

_row

_row(r: dict, names: dict) -> dict

_stats_clean

_stats_clean(s: dict) -> dict

build_execution_model

build_execution_model(data: dict, status: str = '') -> dict

Rows, per-process (and per-version) statistics and key figures. Pure.

status: '' (all), 'failed', 'completed'.

statements_model

statements_model(df, info: dict) -> dict

The statements of one execution, for the side panel. Pure.

_skew

_skew(cpu, max_cpu, amps) -> Optional[float]

process_card_model

process_card_model(data: dict, pid: str, as_of_version=None) -> dict

The feature catalog card's "Runs and consumption" block for one process. Pure.