Skip to content

Commit

Permalink
Add link to res sampling comparison repo
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Jan 19, 2024
1 parent 3b4a1b5 commit 4460389
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sdk/metric/internal/exemplar/rand.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ func (r *randRes[N]) Offer(ctx context.Context, t time.Time, n N, a []attribute.
// Vitter, Jeffrey S. (1 March 1985). "Random sampling with a reservoir"
// (http://www.cs.umd.edu/~samir/498/vitter.pdf)) which has an asymptotic
// runtime of O(n).
//
// See https://github.com/MrAlias/reservoir-sampling for a comparison of
// reservoir sampling algorithms (including performance benchmarks).

if int(r.count) < cap(r.store) {
r.store[r.count] = newMeasurement(ctx, t, n, a)
Expand Down

0 comments on commit 4460389

Please sign in to comment.