Repository navigation
Description
Blocked by #868: experiment_run_clickhouse.py only bulk-loads a data file, so there is no live feed whose start to align to.
Problem
With align_to_interval, the query client should evaluate at multiples of T counted from where the data starts, so every arm (ASAPQuery, ClickHouse, ClickHouse + MV) answers over the same samples.
experiment_run_e2e.pywith the paced feeder does this (feat(asap-tools): run sketch-bench workload tables end to end with the paced feeder #841). It waits for an aligned feeder start and writesclient_options.data_start_timeinto each mode's client config.experiment_run_clickhouse.pydoesn't. feat(asap-tools): render sketch-bench e2e queries as ClickHouse SQL #844's generator (datasets/fake_metric/sketch_bench_workloads.py) setsalign_to_intervalbut nodata_start_time. Its eval times can only come from rounding the wall clock down to a multiple of T.
Example (T = 60 s): two arms run at different times, with feeds starting at 10:02:23 and 14:02:42. Rounding the wall clock gives windows that cover different samples in each arm (shifted by 19 s here), so accuracy comparisons mix input differences with sketch error.
The SQL rounds NOW() to a multiple of T, so windows are grid-aligned, but that doesn't give the arms a shared data origin.
Proposed fix
Once the ClickHouse runner feeds data live (#868), have it do what #841 does for experiment_run_e2e.py:
- Start the feed at the next multiple of the LCM of the aligned intervals (
aligned_interval_lcm/aligned_start_msinexperiment_utils/services/paced_feeder.py). - Write
data_start_time(seconds) into each aligned query group'sclient_optionsbefore the client starts (set_data_start).
The client then evaluates repetition k at data_start_time + (max(1, ceil(starting_delay / T)) + k) * T, the same as for the PromQL runner.
Done when
- ClickHouse-runner configs with
align_to_intervalcarrydata_start_time, and every arm's repetition k covers the same samples. - The wall-clock fallback for
align_to_intervalwithoutdata_start_timeis removed from the client, anddata_start_timebecomes required.
Activity
test(asap-tools): ClickHouse feed starts on the aligned interval (#873)
feat(asap-tools): feed every metric table of a sketch-bench workload …