Skip to content

Commit 708909d

Browse files
committed
s/SketchMetadata/DistributionMetadata/g
1 parent ec8996d commit 708909d

18 files changed

Lines changed: 50 additions & 50 deletions

comp/dogstatsd/http/impl/sketch_iterator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type sketchData struct {
2323
}
2424

2525
type dogstatsdSketchSeries struct {
26-
metrics.SketchMetadata
26+
metrics.DistributionMetadata
2727
Points []sketchData
2828
}
2929

@@ -35,7 +35,7 @@ func (s *dogstatsdSketchSeries) GetName() string {
3535
// WriteTo emits the buffered points to the writer's DDSketch flavor. May be
3636
// called multiple times on the same value; iteration always starts over.
3737
func (s *dogstatsdSketchSeries) WriteTo(w metrics.DistributionWriter) error {
38-
dd, err := w.WriteDDSketch(s.SketchMetadata)
38+
dd, err := w.WriteDDSketch(s.DistributionMetadata)
3939
if err != nil {
4040
return err
4141
}

comp/otelcol/otlp/components/exporter/serializerexporter/consumer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func (c *serializerConsumer) ConsumeSketch(_ context.Context, dimensions *otlpme
141141
msrc = metrics.MetricSourceOpenTelemetryCollectorUnknown
142142
}
143143
c.sketches = append(c.sketches, &metrics.SketchSeries{
144-
SketchMetadata: metrics.SketchMetadata{
144+
DistributionMetadata: metrics.DistributionMetadata{
145145
Name: dimensions.Name(),
146146
Tags: tagset.CompositeTagsFromSlice(enrichTags(c.extraTags, dimensions)),
147147
Host: dimensions.Host(),

pkg/aggregator/check_sampler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func (cs *CheckSampler) newSketchSeries(ck ckey.ContextKey, points []metrics.Ske
9797
return nil
9898
}
9999
ss := &metrics.SketchSeries{
100-
SketchMetadata: metrics.SketchMetadata{
100+
DistributionMetadata: metrics.DistributionMetadata{
101101
Name: ctx.Name,
102102
Tags: ctx.Tags(),
103103
Host: ctx.Host,

pkg/aggregator/check_sampler_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func testCheckHistogramBucketSampling(t *testing.T, store *tags.Store) {
257257

258258
// ~3% error seen in this test case for sums (sum error is additive so it's always the worst)
259259
metrics.AssertSketchSeriesApproxEqual(t, &metrics.SketchSeries{
260-
SketchMetadata: metrics.SketchMetadata{
260+
DistributionMetadata: metrics.DistributionMetadata{
261261
Name: "my.histogram",
262262
Tags: tagset.CompositeTagsFromSlice([]string{"foo", "bar"}),
263263
},
@@ -291,7 +291,7 @@ func testCheckHistogramBucketSampling(t *testing.T, store *tags.Store) {
291291
assert.Equal(t, 1, len(flushed))
292292
// ~3% error seen in this test case for sums (sum error is additive so it's always the worst)
293293
metrics.AssertSketchSeriesApproxEqual(t, &metrics.SketchSeries{
294-
SketchMetadata: metrics.SketchMetadata{
294+
DistributionMetadata: metrics.DistributionMetadata{
295295
Name: "my.histogram",
296296
Tags: tagset.CompositeTagsFromSlice([]string{"foo", "bar"}),
297297
},
@@ -356,7 +356,7 @@ func testCheckHistogramBucketDontFlushFirstValue(t *testing.T, store *tags.Store
356356
assert.Equal(t, 1, len(flushed))
357357
// ~3% error seen in this test case for sums (sum error is additive so it's always the worst)
358358
metrics.AssertSketchSeriesApproxEqual(t, &metrics.SketchSeries{
359-
SketchMetadata: metrics.SketchMetadata{
359+
DistributionMetadata: metrics.DistributionMetadata{
360360
Name: "my.histogram",
361361
Tags: tagset.CompositeTagsFromSlice([]string{"foo", "bar"}),
362362
},
@@ -427,7 +427,7 @@ func testCheckHistogramBucketReset(t *testing.T, store *tags.Store) {
427427

428428
require.Len(t, flushed, 2)
429429
metrics.AssertSketchSeriesApproxEqual(t, &metrics.SketchSeries{
430-
SketchMetadata: metrics.SketchMetadata{
430+
DistributionMetadata: metrics.DistributionMetadata{
431431
Name: "my.histogram",
432432
},
433433
Points: []metrics.SketchPoint{
@@ -436,7 +436,7 @@ func testCheckHistogramBucketReset(t *testing.T, store *tags.Store) {
436436
}, flushed[0], 0.01)
437437

438438
metrics.AssertSketchSeriesApproxEqual(t, &metrics.SketchSeries{
439-
SketchMetadata: metrics.SketchMetadata{
439+
DistributionMetadata: metrics.DistributionMetadata{
440440
Name: "my.histogram",
441441
},
442442
Points: []metrics.SketchPoint{
@@ -502,7 +502,7 @@ func testCheckHistogramBucketMultipleBucketsSampling(t *testing.T, store *tags.S
502502
expSketch.InsertInterpolate(10.0, 20.0, 4)
503503
expSketch.InsertInterpolate(30.0, 40.0, 6)
504504
metrics.AssertSketchSeriesApproxEqual(t, &metrics.SketchSeries{
505-
SketchMetadata: metrics.SketchMetadata{
505+
DistributionMetadata: metrics.DistributionMetadata{
506506
Name: "my.histogram",
507507
Tags: tagset.CompositeTagsFromSlice([]string{"foo", "bar"}),
508508
},
@@ -545,7 +545,7 @@ func testCheckHistogramBucketMultipleBucketsSampling(t *testing.T, store *tags.S
545545
expSketch.InsertInterpolate(10.0, 20.0, 3)
546546
expSketch.InsertInterpolate(30.0, 40.0, 5)
547547
metrics.AssertSketchSeriesApproxEqual(t, &metrics.SketchSeries{
548-
SketchMetadata: metrics.SketchMetadata{
548+
DistributionMetadata: metrics.DistributionMetadata{
549549
Name: "my.histogram",
550550
Tags: tagset.CompositeTagsFromSlice([]string{"foo", "bar"}),
551551
},
@@ -596,7 +596,7 @@ func testCheckHistogramBucketInfinityBucket(t *testing.T, store *tags.Store) {
596596

597597
// ~3% error seen in this test case for sums (sum error is additive so it's always the worst)
598598
metrics.AssertSketchSeriesApproxEqual(t, &metrics.SketchSeries{
599-
SketchMetadata: metrics.SketchMetadata{
599+
DistributionMetadata: metrics.DistributionMetadata{
600600
Name: "my.histogram",
601601
Tags: tagset.CompositeTagsFromSlice([]string{"foo", "bar"}),
602602
},
@@ -635,7 +635,7 @@ func testCheckDistribution(t *testing.T, store *tags.Store) {
635635
expSketch.Insert(quantile.Default(), 1)
636636

637637
metrics.AssertSketchSeriesEqual(t, &metrics.SketchSeries{
638-
SketchMetadata: metrics.SketchMetadata{
638+
DistributionMetadata: metrics.DistributionMetadata{
639639
Name: "my.metric.name",
640640
Tags: tagset.CompositeTagsFromSlice([]string{"foo", "bar"}),
641641
},

pkg/aggregator/demultiplexer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func createIterableMetrics(
126126
if hostTags != nil {
127127
sketch.Tags = tagset.CombineCompositeTagsAndSlice(sketch.Tags, hostTagProvider.GetHostTags())
128128
}
129-
tagsetTlm.updateHugeSketchesTelemetry(&sketch.SketchMetadata)
129+
tagsetTlm.updateHugeSketchesTelemetry(&sketch.DistributionMetadata)
130130
}, flushAndSerializeInParallel.BufferSize, flushAndSerializeInParallel.ChannelSize)
131131
}
132132
return series, sketches

pkg/aggregator/tagset_telem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (t *tagsetTelemetry) updateTelemetry(tagsetSize uint64, atomicCounts []*ato
7373
}
7474

7575
// updateHugeSketchesTelemetry counts huge and almost-huge sketch tagsets.
76-
func (t *tagsetTelemetry) updateHugeSketchesTelemetry(metadata *metrics.SketchMetadata) {
76+
func (t *tagsetTelemetry) updateHugeSketchesTelemetry(metadata *metrics.DistributionMetadata) {
7777
tagsetSize := uint64(metadata.Tags.Len())
7878
t.updateTelemetry(tagsetSize, t.hugeSketchesCount, t.tlmHugeSketches)
7979
}

pkg/aggregator/time_sampler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (s *TimeSampler) newSketchSeries(ck ckey.ContextKey, points []metrics.Sketc
123123
}
124124

125125
ss := &metrics.SketchSeries{
126-
SketchMetadata: metrics.SketchMetadata{
126+
DistributionMetadata: metrics.DistributionMetadata{
127127
Name: ctx.Name,
128128
Tags: ctx.Tags(),
129129
Host: ctx.Host,

pkg/aggregator/time_sampler_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ func testSketch(t *testing.T, store *tags.Store) {
331331

332332
_, flushed := flushSerie(sampler, now, false)
333333
metrics.AssertSketchSeriesEqual(t, &metrics.SketchSeries{
334-
SketchMetadata: metrics.SketchMetadata{
334+
DistributionMetadata: metrics.DistributionMetadata{
335335
Name: name,
336336
Tags: tagset.CompositeTagsFromSlice(tags),
337337
Host: host,
@@ -384,7 +384,7 @@ func testSketchBucketSampling(t *testing.T, store *tags.Store) {
384384

385385
assert.Equal(t, 1, len(flushed))
386386
metrics.AssertSketchSeriesEqual(t, &metrics.SketchSeries{
387-
SketchMetadata: metrics.SketchMetadata{
387+
DistributionMetadata: metrics.DistributionMetadata{
388388
Name: "test.metric.name",
389389
Tags: tagset.CompositeTagsFromSlice([]string{"a", "b"}),
390390
Interval: 10,
@@ -433,7 +433,7 @@ func testSketchContextSampling(t *testing.T, store *tags.Store) {
433433
})
434434

435435
metrics.AssertSketchSeriesEqual(t, &metrics.SketchSeries{
436-
SketchMetadata: metrics.SketchMetadata{
436+
DistributionMetadata: metrics.DistributionMetadata{
437437
Name: "test.metric.name1",
438438
Tags: tagset.CompositeTagsFromSlice([]string{"a", "b"}),
439439
Interval: 10,
@@ -444,7 +444,7 @@ func testSketchContextSampling(t *testing.T, store *tags.Store) {
444444
}, flushed[0])
445445

446446
metrics.AssertSketchSeriesEqual(t, &metrics.SketchSeries{
447-
SketchMetadata: metrics.SketchMetadata{
447+
DistributionMetadata: metrics.DistributionMetadata{
448448
Name: "test.metric.name2",
449449
Tags: tagset.CompositeTagsFromSlice([]string{"a", "c"}),
450450
Interval: 10,
@@ -504,7 +504,7 @@ func testBucketSamplingWithSketchAndSeries(t *testing.T, store *tags.Store) {
504504
expSketch.Insert(quantile.Default(), 1)
505505

506506
metrics.AssertSketchSeriesEqual(t, &metrics.SketchSeries{
507-
SketchMetadata: metrics.SketchMetadata{
507+
DistributionMetadata: metrics.DistributionMetadata{
508508
Name: "distribution.metric.name1",
509509
Tags: tagset.CompositeTagsFromSlice([]string{"a", "b"}),
510510
Interval: 10,
@@ -668,7 +668,7 @@ func TestForcedFlush(t *testing.T) {
668668
expSketch := &quantile.Sketch{}
669669
expSketch.Insert(quantile.Default(), 1)
670670
metrics.AssertSketchSeriesEqual(t, &metrics.SketchSeries{
671-
SketchMetadata: metrics.SketchMetadata{
671+
DistributionMetadata: metrics.DistributionMetadata{
672672
Name: testSketch.Name,
673673
Tags: tagset.CompositeTags{},
674674
Interval: 10,

pkg/metrics/distribution.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Distribution interface {
2727
// allow implementing the whole set of write interfaces by the same type.
2828
type DistributionWriter interface {
2929
// Write Datadog Sketch series.
30-
WriteDDSketch(SketchMetadata) (DDSketchWriter, error)
30+
WriteDDSketch(DistributionMetadata) (DDSketchWriter, error)
3131
}
3232

3333
// DDSketchWriter consumes the points of a DDSketch-backed Distribution.

pkg/metrics/sketch_series.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"github.com/DataDog/datadog-agent/pkg/util/quantile"
1414
)
1515

16-
// SketchMetadata is the per-series metadata required for all distribution variants.
17-
type SketchMetadata struct {
16+
// DistributionMetadata is the per-series metadata required for all distribution variants.
17+
type DistributionMetadata struct {
1818
Name string `json:"metric"`
1919
Tags tagset.CompositeTags `json:"tags"`
2020
Host string `json:"host"`
@@ -25,7 +25,7 @@ type SketchMetadata struct {
2525

2626
// A SketchSeries is a timeseries of quantile sketches.
2727
type SketchSeries struct {
28-
SketchMetadata
28+
DistributionMetadata
2929
Points []SketchPoint `json:"points"`
3030
}
3131

@@ -48,7 +48,7 @@ func (sl SketchSeries) String() string {
4848
// calls it again on a fresh DistributionWriter after a payload split; iterating
4949
// over Points from the start is safe and idempotent.
5050
func (sl *SketchSeries) WriteTo(w DistributionWriter) error {
51-
dd, err := w.WriteDDSketch(sl.SketchMetadata)
51+
dd, err := w.WriteDDSketch(sl.DistributionMetadata)
5252
if err != nil {
5353
return err
5454
}

0 commit comments

Comments
 (0)