Skip to content

test(stats): add page-miss benches for the dashboard and the query log - #278

Merged
henry40408 merged 1 commit into
mainfrom
test/page-miss-benches
Sep 13, 2026
Merged

henry40408 merged 1 commit into
mainfrom
test/page-miss-benches

Conversation

@henry40408

Copy link
Copy Markdown
Owner

Summary

The Statistics page has stats_page_miss_bench; the dashboard and the query log, the other two readers of query_logs, had nothing equivalent, so a change aimed at them had no before/after to show. This adds both, as #[ignore] benches in the same shape.

  • dashboard_page_miss_bench reports the first response (dashboard_page) and the event-stream tick (compute_snapshot), which recurs every TICK_INTERVAL_SECS while a dashboard is open.
  • logs_page_miss_bench reports the list (page 1 and page 20) and the count for every filter /logs offers, alone and combined, with the busiest and the quietest value of each drawn from BENCH_DB itself, plus the domain suggestions the page renders.
  • BENCH_NOW (unix seconds) on all three benches pins the clock, so a copy older than its windows still measures the traffic it holds.

No behaviour change: only #[ignore] benches and the docs that list them (ARCHITECTURE.md, CLAUDE.md).

Baseline at 46e1410

BENCH_DB=<copy> BENCH_NOW=1789212354 cargo nextest run --release --no-capture -j 1 --run-ignored only page_miss_bench

Real database, 370 677 rows (8 days)

dashboard_page_miss_bench
  summary                                         2157        8.4
  top domains + clients                            748        2.9
  top upstreams                                    212        0.8
  FIRST RESPONSE TOTAL                            3117       12.2
  timeline (tick only)                             293        1.1
  TICK TOTAL (compute_snapshot)                   3408       13.3

logs_page_miss_bench (selected rows)
  no filter — count                               1387        5.4
  search contains — count                         3973       15.5
  blocked — count                                 2153        8.4
  token (busy) — count                            5770       22.5
  type (quiet) — list page 1                      2158        8.4
  search prefix + allowed — list page 1           6606       25.8
  token (busy) + blocked — count                 10785       42.1
  token + type (both quiet) — count              10785       42.1
  domain suggestions                              3973       15.5
  SUM OF ALL READINGS                           104829      409.5

stats_page_miss_bench (30d)
  PAGE TOTAL (whole visit)                        7937       31.0

Synthetic database, 1 482 708 rows (31 days, the real week replayed four times)

dashboard_page_miss_bench
  summary                                         9480       37.0
  FIRST RESPONSE TOTAL                           10444       40.8
  TICK TOTAL (compute_snapshot)                  10774       42.1

logs_page_miss_bench
  no filter — count                               6230       24.3
  token (busy) — count                           23130       90.4
  search prefix + allowed — list page 1          26855      104.9
  token (busy) + blocked — count                 42866      167.4
  SUM OF ALL READINGS                           380823     1487.6

stats_page_miss_bench (30d)
  PAGE TOTAL (whole visit)                       31883      124.5

Test plan

  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • cargo nextest run: 680 passed, 8 skipped
  • All three benches run against both databases above

🤖 Generated with Claude Code

The Statistics page had a page-miss bench; the two other readers of
query_logs did not, so a change aimed at them had no before/after to
show.

- dashboard_page_miss_bench reports the first response and the event
  stream tick (compute_snapshot), which recurs every 10 seconds.
- logs_page_miss_bench reports the list (page 1 and page 20) and the
  count for every filter the query log offers, alone and combined, with
  the busiest and quietest value of each drawn from BENCH_DB, plus the
  domain suggestions the page renders.
- All three benches take BENCH_NOW, so a database copy older than its
  windows still measures the traffic it holds.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.14%. Comparing base (46e1410) to head (c7cdb11).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #278   +/-   ##
=======================================
  Coverage   91.14%   91.14%           
=======================================
  Files          31       31           
  Lines       11401    11401           
=======================================
  Hits        10392    10392           
  Misses       1009     1009           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@henry40408
henry40408 marked this pull request as ready for review September 13, 2026 15:12
@henry40408
henry40408 merged commit c28f4a2 into main Sep 13, 2026
7 checks passed
@henry40408
henry40408 deleted the test/page-miss-benches branch September 13, 2026 15:13
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.

1 participant