Skip to content

fix: keep metrics page consistent with the weekly email#1962

Merged
alanpeixinho merged 3 commits into
kernelci:mainfrom
profusion:fix/weekly-cache-metrics-endpoint
Jun 26, 2026
Merged

fix: keep metrics page consistent with the weekly email#1962
alanpeixinho merged 3 commits into
kernelci:mainfrom
profusion:fix/weekly-cache-metrics-endpoint

Conversation

@alanpeixinho

@alanpeixinho alanpeixinho commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Keeps the metrics page and the weekly email showing the same Sat–Fri window,
and keeps the page responsive even on a cache miss.

  • Email computes fresh, so it matches the dashboard.
  • Fixed the dashboard week boundary (was off by a day), so it requests the same
    window and hits the warmed cache.
  • Aligned the cache warm to the Saturday window.
  • Warm the cache on server startup so the page is fast right after a deploy.

Test plan

Remember to set CACHE_TIMEOUT env variable to > 0
  • Metrics page numbers match the latest Saturday email (this/last week).
  • Page is fast immediately after starting.

Closes #1961

@alanpeixinho alanpeixinho force-pushed the fix/weekly-cache-metrics-endpoint branch 3 times, most recently from 6d048d3 to 578873a Compare June 25, 2026 20:43
The dashboard window ended on Sunday instead of Saturday, so mid-week it
requested a different window than the email and missed the warmed cache key.
Align the exclusive end to the most recent Saturday so the page matches the
email window and hits the warm cache.

Part of kernelci#1961

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Warm the cache on web-server startup (gunicorn/runserver only, single-flight
via a Redis lock) so a mid-week deploy doesn't leave the page on the
short-lived cache until the next Saturday cron. Align the warm window to the
latest Saturday so it targets the same Sat-Fri window the dashboard requests
instead of a rolling 7-day window.

Part of kernelci#1961

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Query-level cache in get_metrics_data is enough; view_cache added a second
layer that could serve stale responses after the warmed query cache updates.

Closes kernelci#1961

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@alanpeixinho alanpeixinho force-pushed the fix/weekly-cache-metrics-endpoint branch from 578873a to 4e76cbe Compare June 26, 2026 12:51
@alanpeixinho alanpeixinho added this pull request to the merge queue Jun 26, 2026
Merged via the queue into kernelci:main with commit e026a5b Jun 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metrics email and dashboard can be inconsistent and slow

1 participant