Skip to content

test(e2e): 5-sketch coverage — add KLL strict-success + HLL ignored-with-gap - #254

Merged
zzylol merged 1 commit into
mainfrom
five-sketch-coverage
May 15, 2026
Merged

zzylol merged 1 commit into
mainfrom
five-sketch-coverage

Conversation

@zzylol

@zzylol zzylol commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends the e2e test suite to cover the second and third sketch families. DDSketch is strict-success in Test 3 (post-#253); this PR adds KLL (passing strict success) and HLL (ignored with a precise gap note for follow-up).

Test 4 — controller_plan_to_query_full_roundtrip_kll (passes)

Mirrors Test 3 with sketch_type_override: Some(SketchType::KLL). Builds a KllState, wraps in KllSketchDataPoint, OTLP-POSTs, queries quantile_over_time(0.5, request_size_bytes[10s]), asserts status == "success". Also asserts the controller emits aggregationType: DatasketchesKLL for the override.

The execute(&str) trait dispatcher from #253 handles KLL identically to DDSketch — both route through SketchReducer::evaluate with quantile readout dispatch.

Test 5 — controller_plan_to_query_full_roundtrip_hll (#[ignore]'d)

Workload pins HLL with AggType::Cardinality. Streaming-config registers correctly (aggregationType: HLL); sketch state lands in SketchStore — but the PromQL query path for HLL needs a query shape the analyzer recognises as Capability::CardinalityApprox. count(metric) doesn't map today: resolve_sketch_metric_alias only rewrites count(metric)count(metric_hll) when the bare metric is ABSENT (a deploy-time aliasing tactic). With bare registered, alias is a no-op and the analyzer doesn't bind count(...) to cardinality capability.

#[ignore]'d with a precise doc-comment. The OTLP ingest path for HLL is unaffected (works fine; verifiable via runtime_info); the readout side needs follow-up analyzer / alias work.

Test plan

  • cargo test --test e2e_controller_plans_and_backend_serves: 4 passed; 0 failed; 1 ignored (HLL).

What's left for full 5-sketch coverage

CountSketch (topk) and CountMinSketch (frequency / count) need their own tests + likely similar analyzer routing work. Two paths to ship them:

  1. Wait for the analyzer-side fix on HLL — same fix likely unblocks all three.
  2. Use the demo-contract metric names (top_endpoint_qps, endpoint_request_freq) which classify_demo_metric routes directly, bypassing the analyzer's bare-name handling.

🤖 Generated with Claude Code

…ith-gap

Extends the e2e test suite to cover the second and third sketch
families (DDSketch is already strict-success-asserted in Test 3).

## Test 4 — controller_plan_to_query_full_roundtrip_kll (passes)

Mirrors Test 3 with `sketch_type_override: Some(SketchType::KLL)`.
Builds a `KllState` via `asap_sketchlib::proto::sketchlib::KllState`,
wraps in `KllSketchDataPoint`, OTLP-POSTs, watermark-advances,
queries `quantile_over_time(0.5, request_size_bytes[10s])`, asserts
`status == "success"`. Also asserts the controller emits
`aggregationType: DatasketchesKLL` for the override.

This validates the second of the five sketch families on the
gateway-less data path. The `execute(&str)` trait dispatcher (#253's
fallback) handles KLL identically to DDSketch — both route through
`SketchReducer::evaluate` with quantile readout dispatch.

## Test 5 — controller_plan_to_query_full_roundtrip_hll (#[ignore]'d)

Workload pins HLL with `AggType::Cardinality`. The streaming-config
registration succeeds (`aggregationType: HLL` confirmed) and the
sketch state lands in `SketchStore` — but the PromQL query path for
HLL needs a query shape the analyzer recognises as
`Capability::CardinalityApprox`. `count(metric)` doesn't map today:
`resolve_sketch_metric_alias` only rewrites `count(metric)` →
`count(metric_hll)` when the bare metric is ABSENT (a deploy-time
aliasing tactic). With bare registered, alias is a no-op and the
analyzer doesn't bind `count(...)` to the cardinality capability.

`#[ignore]`'d with a precise note pointing at the gap. The OTLP
ingest path for HLL works (no `#[ignore]` on ingest); the readout
side needs follow-up analyzer / alias work.

## Helper changes

- Splits `build_workload` into `build_workload` (no override) and
  `build_workload_with_override` (with `sketch_type_override`).
- Adds `build_kll_state` / `build_kll_export` / `build_hll_state` /
  `build_hll_export` mirrors of the existing DDSketch helpers.

## Tests

- `cargo test --test e2e_controller_plans_and_backend_serves`:
  **4 passed; 0 failed; 1 ignored** (HLL).

## What's left for full 5-sketch coverage

CountSketch (topk) and CountMinSketch (frequency / count) need their
own tests + likely similar analyzer routing work as HLL. Two paths to
ship those:

1. Wait for the analyzer-side fix on HLL — same fix likely unblocks
   all three.
2. Use the demo-contract metric names (`top_endpoint_qps`,
   `endpoint_request_freq`) which `classify_demo_metric` routes
   directly, bypassing the analyzer's bare-name handling.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit f8ec517 into main May 15, 2026
@zzylol
zzylol deleted the five-sketch-coverage branch July 17, 2026 20:05
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