Repository navigation
Conversation
zzylol
force-pushed
the
bench-external/run-slice
branch
from
November 17, 2026 16:46
af7fa57 to
671d399
Compare
zzylol
force-pushed
the
engines-external/clickhouse-adapter
branch
3 times, most recently
from
November 17, 2026 18:37
ef51665 to
d483622
Compare
- The adapter against an HTTP stub: install creates a database per install and the translated tables in it; query ids map by index and text (any language); stored steps must divide the evaluation interval and the data start; ingest sends one insert per source table in chunk order, with the series identity as sorted JSON and TSV escaping; evaluate parses series and values; exception headers, error statuses and a silent server are errors; footprint, description, CPU accounting, leftover databases, and SYNC drops. - The clickhouse lane needs its server and cgroup agent. - scripts/extbench-up.sh parses and refuses public listen addresses. - Conformance against a real server (ignored without one): one case per capability README row with hand-computed answers, the harness conformance kit, a suite-sized workload, and the lane against the fake lane. - Planner-written probe plans for the harness kit.
- ClickHouseEngine (EngineUnderTest over HTTP): each install translates its plan file into a fresh database; one insert per source table per chunk; every query root at t with param_t, max_threads and wait_end_of_query; answers keyed by the workload query ids, series by the decoded series identity or by the label columns; footprint from system.parts; CPU from the server's cgroup through the agent (the server reports no per-query CPU in its summary header, so the engine counter is None). - The translator also returns each metric's source table and label columns and the stored tables. - approxbench bench-external run --lane clickhouse --clickhouse-url URL --cgroup-agent-url URL [--clickhouse-max-threads N]. - scripts/extbench-up.sh starts the server in a pinned container from a checked binary, with settings as command-line overrides (without a main config file the server reads no config.d), on a private address only, with the cgroup agent beside it and versions.txt.
… adapter - Ingest makes one pass over the chunk, with each source's insert statement built once at install; a chunk with a sample at or before 0 inserts nothing; label names are quoted as the translator quotes them; TSV escapes \r and reads \r, \b and \f back. - Install numbers its database from one counter for the whole process, so two engines in one process never share a database name. - The fake lane refuses the clickhouse flags. - extbench-up.sh: kills only its own agent, checks the agent answers, pins the agent with AGENT_CORES, resolves relative paths, gives the server's other protocols fixed ports on the private address (a port of 0 binds a random one), and never wipes a data dir it did not make (tested). - A failed install drops its database (tested); the README maps each capability row to its conformance case.
… is a bare selector PromQL's output labels: a function or aggregation drops the metric name, and only a bare selector keeps it. The report joins lanes by exact label maps, so the ClickHouse lane must key answers that way.
The ClickHouse lane keys answers by PromQL's output labels: a root that applies a function or aggregation drops the metric name, and a root that is only an instant selector keeps it.
zzylol
force-pushed
the
bench-external/run-slice
branch
from
November 17, 2026 20:13
31a0040 to
7c0d121
Compare
zzylol
force-pushed
the
engines-external/clickhouse-adapter
branch
from
November 17, 2026 20:13
d483622 to
c9e5042
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bench-externalhas no ClickHouse lane, so a planner plan cannot run on a ClickHouse server. Example: the showcasesum by (job) (sum_over_time(latency[1m])), every 10 s over 1,000 series, planned withcapabilities/clickhouse.equivalent-only.json. engines-external: read an ASAPPlanner plan file and translate it to ClickHouse views #260 can translate that plan to SQL, but nothing installs the SQL on a server, feeds it the harness's data, or reads the server's CPU and memory.ClickHouseEngine, anEngineUnderTestthat talks to a ClickHouse server over HTTP. Each install translates its plan file into a fresh database.clickhouselane:approxbench bench-external run --lane clickhouse --clickhouse-url URL --cgroup-agent-url URL.scripts/extbench-up.sh, which starts the server: a checked binary in a pinned container on given cores, with the cgroup agent beside it.clickhouselane and match thefakelane exactly in the report (0 missing points, 0 extra points, error 0). Every README row's conformance case passes on ClickHouse 26.8.39.13.Review guide
bench-external/run-slice). Draft.c7a36bb: the failing tests (the module, the lane and the script did not exist yet);f9b5ae8: the implementation;61853a1: the fixes from the independent implementation review.aqpbm-engines-external/src/clickhouse_server.rs:ClickHouseEngine::install,ClickHouseArm::ingest/evaluate,parse_answer,Http::run. Thenscripts/extbench-up.sh.aqpbm-cli/src/bench_external_cmd.rs; theSourceTableandstored_tablesoutputs of the translator; the two planner-written probe plans (tests/fixtures/plans/REV).How the adapter runs an arm
CREATE DATABASE bench_<pid>_<n>, then the translated tables and views withdatabase=<db>INSERT … SETTINGS input_format_null_as_default = 0, insert_null_as_default = 0 SELECT … FROM input(…) FORMAT TabSeparatedwith the chunk's rows in chunk orderparam_t=t,max_threads=<n>(1 by default),FORMAT TabSeparatedWithNamessystem.partsbytes of the view tables and of the source tablesDROP DATABASE … SYNCwait_end_of_query=1, so a mid-answer exception (e.g. thethrowIfon an evaluation time that is not a window end) is an error, andmax_execution_time.__name__kept, as the harness keys answers); an aggregated answer by its label columns, empty ones left out (as PromQL leaves out an empty label).tsorvalue;CpuAccounting::Cgroup).elapsed_nsandmemory_usage. Soengine_reported_cpu_nsisNone.scanned_bytesis the summedread_bytes.Conformance on a real server
The server was started with
scripts/extbench-up.sh(cores 2 and 22, one physical core, NUMA node 0; agent on another core). The tests ran from the driver host over the private network:cargo test -p aqpbm-engines-external --test clickhouse_conformance -- --ignored --test-threads 1, 13 of 13 passed.stored_sum_count_min_maxstored_rate_is_promql_minus_the_first_value_after_each_reset, three installs fed in turn, max_threads 1 and 16query_time_rate_is_promqlAggregategrouped_sums_quantiles_and_aggregatesinstant_selectortop_k_ties_and_nanProject,BinaryOpaverage_as_sum_over_count_and_checked_divisionclass_c_rows_are_refusedquery_time_rate_is_promql,storage_and_retentionthe_harness_conformance_kit_passesthe_server_is_the_pinned_binaryOther measurements:
the_clickhouse_lane_matches_the_fake_lane, warm-up 1, 3 runs): both probe workloads Ran, with 0 missing points, 0 extra points and error 0. Query CPU was about 6–8 ms per evaluation on the server's cgroup, against 0.009 ms for the in-process fake.suite_sized_workload): 1,000 series, 1 s samples, 10 min from 1,700,000,000,000 ms; 60 inserts of 10,000 rows and 55 evaluations in 10.3 s wall time, using 3.3 s of server cgroup CPU. The answers equal the per-job sums computed in the test, and the server was never throttled.Start script
config.d. Checked:display_nameand the logger level did not change. Settings are therefore--key=valueoverrides.LISTEN_HOSTthat is not private or loopback (0.0.0.0 and public addresses; tested);AGENT_CORESpins it.Interfaces
Design scope
aqpbm-engines-external/src/clickhouse_server.rsSourceTable,stored_tablesscripts/extbench-up.shNot in this PR
system.query_logread after the arm, and the harness has no after-arm hook yet.Verification
cargo test -p aqpbm-engines-external -p aqpbm-cli: all pass.cargo clippy -p aqpbm-engines-external -p aqpbm-cli --all-targets -- -D warnings: clean.cargo fmt --all --check: clean.