k4bench.analysis.trend¶
k4bench.analysis.trend ¶
Pure, Streamlit-free trend aggregation over benchmark run directories.
Each build_*_trend function takes the already date-windowed set of cached
run directories (see :func:k4bench.remote.fetch_runs_windowed) and returns a
long-form DataFrame keyed by run_id / x_date (nightly tag), or None
when no data could be loaded. The dashboard wraps these in @st.cache_data
(see dashboard/data.py); the nightly regression report calls them directly
from CI, which is why they must not import Streamlit.
parse_run_dir ¶
Extract run metadata from a date-level run directory.
Expected path structure::
{detector}/{platform}/{stack}/{sample}/{YYYY-MM-DD}/
Prefers run_info.json when present; falls back to inferring fields
from the directory path.
Source code in k4bench/analysis/trend.py
load_machine_info ¶
Load machine_info.json from a run directory, or return None if absent.
Source code in k4bench/analysis/trend.py
build_results_trend ¶
Load per-config results across run_dirs into one combined DataFrame.
Each row gets run_id, run_date, platform, k4h_release,
k4h_release_date, github_run_url and x_date columns.
Source code in k4bench/analysis/trend.py
build_region_timing_trend ¶
Load per-region timing summary across run_dirs.
For each run directory, region timing is loaded for all available configs. Per detector per config per run, the median and mean event-level time are computed (event 0 excluded as warmup).
Returns a long-form DataFrame with columns:
run_id, run_date, k4h_release_date, label, attribution, detector,
median_time_s, mean_time_s
or None if no data could be loaded. run_id lets callers join each row
with its run's reliability verdict (see k4bench.results.reliability_evidence).
Source code in k4bench/analysis/trend.py
build_event_timing_trend ¶
Load per-event timing and memory summary across run_dirs.
For each run directory, event timing is loaded for all available configs. Per config per run, summary statistics are computed (event 0 excluded): mean_time_s, median_time_s, p95_time_s, mean_rss_mb, median_rss_mb, p95_rss_mb, max_rss_mb
Returns a long-form DataFrame with those columns plus
run_id, run_date, k4h_release_date, k4h_release, label
or None if no data could be loaded. run_id lets callers join each row
with its run's reliability verdict (see k4bench.results.reliability_evidence).
Source code in k4bench/analysis/trend.py
build_machine_info_trend ¶
Load per-run machine load / memory metrics across run_dirs.
Unlike the other trend builders there is no per-config dimension: each run
directory has a single machine_info.json describing the physical machine
that executed the benchmark. One row per run captures the load average,
available RAM, swap, frequency and throttle counters, so callers can see how
the host's condition varied across nightly releases (e.g. a day where the
machine was under unusually high load).
Returns a DataFrame with one row per run plus run_id, run_date,
k4h_release_date, k4h_release and x_date columns, or None
if no machine info could be loaded. run_id lets callers join the
machine condition of a run with its per-config results (e.g. to attach a
reliability verdict to each run).