Skip to content

system-bench: ASAPQuery-backend adapter and VictoriaMetrics without a plan - #270

Merged
GordonYuanyc merged 2 commits into
mainfrom
system-bench/end-to-end-adapters
Nov 25, 2026
Merged

GordonYuanyc merged 2 commits into
mainfrom
system-bench/end-to-end-adapters

Conversation

@GordonYuanyc

@GordonYuanyc GordonYuanyc commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Step 6b of #267 (decisions D11 and D12). #269 is merged; this PR is now based on main.

What changes

  • system_bench::prometheus_api: the pieces both end-to-end systems share, moved out of systemeval so they are written once:
    • remote_write: the Remote Write encoder and sending (send, send_until_accepted), plus request_of(&[Sample]) from harness samples;
    • query: the PromQL instant query over HTTP (ask, and ask_with for extra parameters such as nocache=1).
      systemeval now uses them from there; its output is unchanged.
  • ASAPQuery-backend adapter (engines_external::asapquery_backend_server, engine asapquery-backend):
    • ingest: each refresh chunk by Remote Write in batches of 10,000 samples, then the watermark through the chunk end;
    • evaluate: each query's PromQL, keeping finite values, as systemeval does;
    • takes no plan file, and one arm per server start (it keeps every sample written to it);
    • version reads unreported: the server has no version endpoint.
  • VictoriaMetrics adapter, normal use (D12: one adapter): an arm with no plan file (a plans: false variant from harness: declared statistics in workloads, --truth declared, and variants without plans #269):
    • deletes the workload's metrics at install and at drop;
    • ingests by Remote Write and force_flush;
    • asks the query's MetricsQL text, or its PromQL text, with nocache=1.
      Plan arms are unchanged. cgroup and stream_aggregation_config are now optional on VictoriaMetricsServer, for a driver that measures no CPU (systemeval, in 6c); a plan arm without them is refused.
  • CLI: benchmark-external run --engine asapquery-backend --asapquery-backend-url <url> --server-cgroup-directory <dir> [--server-ssh-host <host>], with --warmup 0 --runs 1.
  • Rename lcm → least_common_multiple in the VictoriaMetrics adapter, as main did elsewhere.

After the independent review (commit 2e9d7f9)

  • One code path for arms without a plan. Both adapters' arms without a plan now share prometheus_api::query_text_arm:
    • __name__ is dropped unless the query is a bare selector, as the plan arm does;
    • non-finite values are kept;
    • two answers for one series are refused;
    • each chunk is written in time order, as systemeval does, in batches of 10,000.
  • ASAPQuery-backend footprint: read from /metrics (asap_view_bytes, asap_raw_data_bytes).
  • Adapter location: the ASAPQuery-backend adapter moved to engines_external, beside the other server adapters.
  • cgroup: both adapters need one again, so no adapter falls back to counting the harness's own thread.
  • VictoriaMetrics config file: needed only by arms with a plan file; the --victoriametrics-stream-aggregation-config flag is now optional.
  • VictoriaMetrics connection: one connection type, VictoriaMetricsConnection (formerly Http), with one force_flush.
  • Tests:
    • __name__ handling, NaN, and duplicate series;
    • write order over three batches, and a busy (503) answer;
    • the footprint;
    • one VictoriaMetrics arm at a time, and reinstalling after drop;
    • the fake engine refusing the server flags.
  • Not changed:
    • A failing query fails the cell, as for every other engine in the harness. systemeval's per-query failure records stay in systemeval.
    • The VictoriaMetrics arm without a plan sends as fast as the server accepts: only stream aggregation needs real-time pacing.

Notes

  • systemeval still has its own System trait; 6c makes it drive these adapters and removes the trait.

Checked (macOS)

  • cargo fmt --check; cargo clippy -p system-bench -p aqpbm-cli --all-targets -- -D warnings, with and without --all-features.
  • New tests: system-bench/tests/end_to_end_adapters.rs runs both adapters against a recording fake server, checking the samples written, the watermark, delete_series, nocache=1, the answers, and the refusals. Also new CLI tests for asapquery-backend.
  • Remaining failures are the known Linux-only ones.

🤖 Generated with Claude Code

… plan

Step 6b of #267 (decisions D11, D12), stacked on 6a (#269):

- prometheus_api holds what the end-to-end systems share: the Remote
  Write encoder and sending (moved from systemeval, with a request built
  from harness samples) and the PromQL instant query over HTTP (moved
  from systemeval's query module, with extra parameters such as
  nocache=1). systemeval uses them from there; its output is unchanged.
- systemeval::asapquery_backend_server: ASAPQuery-backend as an engine
  under test. It writes each refresh chunk by Remote Write, closes the
  panes through the chunk end (watermark), and asks each query's PromQL.
  It takes no plan file and one arm per server start.
- The VictoriaMetrics adapter runs an arm with no plan file (a
  plans: false variant) the normal way: Remote Write, force_flush, the
  query's MetricsQL or PromQL text with nocache=1; the workload's metrics
  are deleted at install and at drop. Its cgroup and config file are
  optional; a plan arm still needs both.
- benchmark-external run takes --engine asapquery-backend with
  --asapquery-backend-url.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GordonYuanyc
GordonYuanyc force-pushed the system-bench/end-to-end-adapters branch from ae58ceb to 0c6ab19 Compare November 25, 2026 09:31
@GordonYuanyc
GordonYuanyc changed the base branch from harness/declared-truth-and-plan-free-variants to main November 25, 2026 09:31
- Answers of an arm without a plan follow the harness's keys:
  prometheus_api::query_text_arm drops __name__ unless the query is a
  bare selector, keeps non-finite values and refuses two answers for one
  series, as the plan arm does; both adapters use it.
- Each chunk is written in time order (as systemeval does), so a later
  metric of the chunk does not move the server's watermark past an
  earlier one.
- ASAPQuery-backend's footprint reads asap_view_bytes and
  asap_raw_data_bytes from /metrics; its adapter moves to engines_external
  beside the other server adapters, and both adapters need a cgroup again.
- VictoriaMetrics: the stream-aggregation config is needed only by arms
  with a plan file (the flag is optional); one connection type
  (VictoriaMetricsConnection, formerly Http) with one force_flush.
- Tests: __name__, NaN, duplicates, write order over three batches, a busy
  answer, the footprint, one VictoriaMetrics arm at a time, the fake
  engine refusing server flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GordonYuanyc
GordonYuanyc merged commit 3a74c06 into main Nov 25, 2026
2 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.

1 participant