Aludel.Stats.Overview (aludel v0.7.0)

Copy Markdown View Source

Top-line dashboard metrics and bounded period comparisons.

Summary

Functions

Returns average latency across prompt-run results, or zero when unavailable.

Compares the current period with the immediately preceding period.

Compares adjacent periods ending at the supplied UTC timestamp.

Returns seven-day and thirty-day period comparisons keyed by window length.

Calculates a percentage success rate, returning 0.0 when no tests exist.

Returns total passed and failed tests across suite runs.

Counts all recorded prompt runs and suite runs.

Functions

avg_latency()

@spec avg_latency() :: number()

Returns average latency across prompt-run results, or zero when unavailable.

comparison_stats(days \\ 7)

@spec comparison_stats(pos_integer()) :: map()

Compares the current period with the immediately preceding period.

The period defaults to seven days. Counts, quality, cost, latency, stability, regression signals, and total-run trend are calculated with bounded period queries.

comparison_stats(days, as_of)

@spec comparison_stats(pos_integer(), DateTime.t()) :: map()

Compares adjacent periods ending at the supplied UTC timestamp.

rolling_comparisons(as_of \\ current_as_of())

@spec rolling_comparisons(DateTime.t()) :: %{required(pos_integer()) => map()}

Returns seven-day and thirty-day period comparisons keyed by window length.

success_rate(passed, failed)

@spec success_rate(integer(), integer()) :: float()

Calculates a percentage success rate, returning 0.0 when no tests exist.

test_totals()

@spec test_totals() :: {integer(), integer()}

Returns total passed and failed tests across suite runs.

total_runs()

@spec total_runs() :: integer()

Counts all recorded prompt runs and suite runs.