Skip to content

feat(asap-tools): run generated2 PromQL workloads on ClickHouse - #837

Merged
milindsrivastava1997 merged 2 commits into
mainfrom
clickhouse-generated2-workloads
Oct 13, 2026
Merged

milindsrivastava1997 merged 2 commits into
mainfrom
clickhouse-generated2-workloads

Conversation

@milindsrivastava1997

Copy link
Copy Markdown
Contributor

Summary

Runs the generated2 workloads (ASAPQuery vs Prometheus/VictoriaMetrics) as a standalone ClickHouse baseline, using SQL with the same semantics as Prometheus 2.53, instead of going through ASAPQuery's SQL support.

  • datasets/fake_metric/generate_data.py + init.sql: fake_exporter-equivalent data (zipf, valuescale 10000, 3 labels x 20 values, counter with one shared accumulator per instance, 1s scrapes). --num-instances sets the scale (1 = 1x, 10 = 10x).
  • datasets/fake_metric/generate_workloads.py: maps the PromQL shapes used in generated2 to templated ClickHouse SQL and writes one baseline-only experiment_run_clickhouse.py config per workload (to the gitignored config/experiment_type/generated2_clickhouse/). Unknown shapes raise an error.
    • Instant vectors read (T-1s, T]; range vectors [d] read (T-d, T].
    • Quantiles use quantileExactInclusive, which interpolates the same way as Prometheus quantile.
    • rate/increase reproduce extrapolatedRate from Prometheus 2.53. There is no counter-reset handling because the fake counters never reset.
  • prometheus-client: new client_options.simulated_start_time. When set, {{ end_time }} advances on a clock anchored at the start of the bulk-loaded data rather than the wall clock. Pacing between repetitions is unchanged. A later paced-feeder run can drop this option and keep the same SQL.

Testing

  • Ran all 27 distinct generated SQL statements in clickhouse-local and compared them against a separate Python implementation of the PromQL semantics. Every statement matched at 3 evaluation times, which together cover both rate-extrapolation branches, the zero clamp, and empty windows.
  • Checked with a stubbed client that simulated_start_time together with starting_delay, repetition_delay_ms and query_time_offset renders the expected end_time.
  • Ran config 1 at 1x end to end on CloudLab: all 5775 queries returned complete results (20 rows per group-1 query, 8000 per group-2 query).

🤖 Generated with Claude Code

milindsrivastava1997 and others added 2 commits October 12, 2026 13:34
…nerated2 workloads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e SQL configs

Adds a client_options.simulated_start_time so templated SQL can be evaluated
against bulk-loaded data with fixed timestamps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milindsrivastava1997
milindsrivastava1997 merged commit f70a737 into main Oct 13, 2026
16 checks passed
zzylol added a commit that referenced this pull request Oct 13, 2026
Brings in origin/main (#837, #828) and the switch to the table's ASAPQuery
SQL. Conflicts resolved by keeping both sides: the module docstring keeps
this branch's per-arm outputs with the new asapquery.sql line; the tests
keep PlanViewsTest and FlooredEndDatetimeTest; experiment_run_clickhouse
and its test import both _ingest_mode and #828's prebuilt-output helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AnJ7LocWxguh3q4QWkCYae
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