Skip to content

feat(rust): SDK-side row-admission sampling mirror (asap-precompute-rs) - #537

Merged
zzylol merged 1 commit into
mainfrom
split/pr-rust-sampling-mirror
Jul 17, 2026
Merged

zzylol merged 1 commit into
mainfrom
split/pr-rust-sampling-mirror

Conversation

@zzylol

@zzylol zzylol commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

PR-E of 5 in the #518 extraction effort (see plan context below). This is the
Rust/OTAP-path mirror of the Go SDK's NitroSketch-style row-admission
sampling — parallel to the already-merged Go SDK work (AggregationRowSampledSketch,
ApplyAdmittedOccurrence from #530).

  • Adds sampling.rs (new): producer-side geometric skip-sampling, mirroring
    sketchlib-go's common.GeometricSampler.
  • Wires WithSampleP through precompute.rs and the CountMinSketch/
    CountSketch/DDSketch wrappers (sketches/{cms,countsketch,ddsketch}.rs),
    plus a small lib.rs export update.

Content pulled from feat/gos-unified-monitoring (the long-lived integration
branch), confirmed byte-identical to stale PR #518's version of this subtree —
so no functional changes from what #518 already proposed here, just a clean
rebase onto current main. Independent of PR-A through PR-D; can be reviewed/merged
in any order relative to those.

No license header changes were needed: none of the 6 touched files carry a
copyright header in either source (they start directly with //! doc
comments), so there was nothing to correct per #534's convention.

Test plan

  • cargo build clean against current main
  • cargo test — all 96 tests pass (58 unit + 11 api_surface + 27 runtime + 0 otap-feature-gated)
  • Verify PR shows CLEAN/MERGEABLE against main

🤖 Generated with Claude Code

Ports asap-precompute-rs's producer-side geometric skip-sampling
(sampling.rs, new) plus the WithSampleP wiring through precompute.rs
and the CMS/CountSketch/DDSketch wrappers — the Rust/OTAP-path mirror
of the Go SDK's NitroSketch-style row-admission sampling already
merged on the Go side (AggregationRowSampledSketch, ApplyAdmittedOccurrence).

Mirrors sketchlib-go's common.GeometricSampler; the SDK decides, per
raw occurrence at Record() time, which rows of the target physical
sketch get updated.

Part of the #518 extraction (PR-E of 5); pulled from
feat/gos-unified-monitoring, confirmed byte-identical to #518's
stale branch for this subtree. cargo build/test clean against main.
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