Skip to content

refactor(hllprocessor): thin shim delegating to asap-precompute-go (Phase 2 step 2.7) - #228

Merged
zzylol merged 1 commit into
mainfrom
phase2/hll-shim
May 4, 2026
Merged

zzylol merged 1 commit into
mainfrom
phase2/hll-shim

Conversation

@zzylol

@zzylol zzylol commented May 3, 2026

Copy link
Copy Markdown
Contributor

Summary

LoC delta

processor.go shrinks from 786 LoC264 LoC (state machine moves to runtime). New files: sketch_wrapper.go (216), encode.go (235), selfmonitor.go (63). Total production LoC: 995 across 6 files.

Parity result

TestParity_HLL passes byte-identical (3 envelopes match). Full parity suite green:

=== RUN   TestParity_HLL
    parity_test.go:105: parity OK: 3 envelopes matched byte-for-byte
--- PASS: TestParity_HLL (0.47s)

Notes

  • HLL output emits AggregationTemporalityCumulative (not Delta like KLL) — matches legacy.
  • Default output metric name is <input>_hll_cardinality; MetricSuffix overrides as before.
  • FlushWindow uses a monotonically-advancing pseudo-tick timestamp so repeated forced rotations don't get stuck on the same already-advanced bucket.
  • Cardinality reconstruction for delta-encoded outbound dps is done in the shim's encode layer (per-series snapshot map keyed by (metric, series-attrs)) since the runtime drops the live sketch handle after Tick.

Test plan

  • go test ./... in opentelemetry-collector-contrib-patch/processor/hllprocessor (8 tests, including delta_transmission_test.go and integration_test.go)
  • go test -race ./... clean
  • go vet ./... clean
  • go test -v -run TestParity_HLL ./integration/parity/... byte-identical
  • Full parity suite (go test ./integration/parity/...) green

🤖 Generated with Claude Code

HLL processor reduces from ~785 LoC to a thin shim. State machine moves
to asap-precompute-go. sketch_wrapper.go implements CardinalitySketch
over sketchlib-go HLL.

Public test API: Shim.ProcessBatch/ProcessMetrics/FlushWindow.

Parity harness: TestParity_HLL byte-identical (3 envelopes).

Phase 2 step 2.7.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit c546b76 into main May 4, 2026
@zzylol
zzylol deleted the phase2/hll-shim branch May 4, 2026 13:32
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