Skip to content

tdfs4ds.serve.process_evolution

tdfs4ds.serve.process_evolution

Evolution of one process over its time steps, with a forecast (pure, no I/O).

The input is the frame :func:tdfs4ds.utils.execution_resources.read_execution_resources returns (one row per execution = one FilterManager segment or one TimeManager date). A process run over a clock (VALIDTIME_DATE not null) is aggregated BY TIME STEP: the segments of one step are summed (elapsed, CPU, I/O) or maxed (spool). A process with no time step (real-time runs) has one point per execution, at START_DATETIME.

The forecast is deliberately modest: a Theil-Sen line over the step index (robust to outliers), a band from the residual quantiles 10 / 90 that widens with the distance, never negative, and none at all under :data:MIN_POINTS steps.

MIN_POINTS module-attribute

MIN_POINTS = 6

MAX_FUTURE_STEPS module-attribute

MAX_FUTURE_STEPS = 400

MAX_FIT_POINTS module-attribute

MAX_FIT_POINTS = 400

HORIZON_DAYS module-attribute

HORIZON_DAYS = {'month': 30, 'quarter': 91, 'semester': 182, 'year': 365}

METRICS module-attribute

METRICS = {'elapsed': ('Elapsed time', 'ELAPSED_SEC', 'sum', 'sec'), 'cpu': ('CPU', 'AMP_CPU_SEC', 'sum', 'sec'), 'io': ('I/O', 'TOTAL_IO', 'sum', 'count'), 'spool': ('Peak spool', 'MAX_SPOOL_BYTES', 'max', 'bytes'), 'segments': ('Segments per step', None, 'count', 'count')}

_EPOCH module-attribute

_EPOCH = 86400.0

_esc

_esc(x) -> str

_iso

_iso(t: float) -> str

_to_seconds

_to_seconds(series)

Epoch seconds (wall clock, zone dropped) of a column of dates, NaN where unreadable.

evolution_series

evolution_series(frame, metric: str = 'elapsed') -> dict

Points of one process: {points, by_step, metric, has_segments, state}.

A point is {x, t, y, n_segments, n_runs, failed}; y is None when the metric was not measured for that step. frame must hold one process.

_point

_point(t, g, metric, how, n_runs) -> dict

steps_for_horizon

steps_for_horizon(points, horizon: str)

(n_future_steps, gap_days, horizon_days) from the median gap between steps.

forecast_series

forecast_series(points, horizon: str = 'quarter') -> dict

{future, summary}: future points {x, t, y, lo, hi} and the summary.

Never fabricates: under :data:MIN_POINTS usable steps summary['enough'] is False with a reason and future is empty.

_theil_sen_x

_theil_sen_x(x, y)

Theil-Sen over irregular positions x (increasing).

format_value

format_value(v, unit: str) -> str

_nice_max

_nice_max(v: float) -> float

render_evolution_svg

render_evolution_svg(points, forecast, metric: str = 'elapsed', width: int = 860, height: int = 280, by_step: bool = True) -> str

One inline SVG (no script, no external request) of the history and the forecast.

_gap_text

_gap_text(days) -> str

summary_table_html

summary_table_html(series: dict, forecast: dict) -> str

analyse

analyse(frame, metric: str = 'elapsed', horizon: str = 'quarter') -> dict

Series + forecast + state for one process frame (what the panel returns).