Codebase list golang-github-datadog-datadog-go / ad53dd7
New upstream release. Debian Janitor 1 year, 11 months ago
6 changed file(s) with 39 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
00 ## Changes
11
22 [//]: # (comment: Don't forget to update statsd/telemetry.go:clientVersionTelemetryTag when releasing a new version)
3
4 # 5.1.1 / 2022-05-05
5
6 - [BUGFIX] Fix issue where tags of aggregated contexts could be modified after being sampled. See [#258][].
37
48 # 5.1.0 / 2022-03-02
59
391395 [#253]: https://github.com/DataDog/datadog-go/pull/253
392396 [#254]: https://github.com/DataDog/datadog-go/pull/254
393397 [#255]: https://github.com/DataDog/datadog-go/pull/255
398 [#258]: https://github.com/DataDog/datadog-go/pull/258
394399 [@Aceeri]: https://github.com/Aceeri
395400 [@Jasrags]: https://github.com/Jasrags
396401 [@KJTsanaktsidis]: https://github.com/KJTsanaktsidis
0 golang-github-datadog-datadog-go (5.1.0-1) UNRELEASED; urgency=low
0 golang-github-datadog-datadog-go (5.1.1-1) UNRELEASED; urgency=low
11
22 * New upstream release.
3 * New upstream release.
34
4 -- Debian Janitor <janitor@jelmer.uk> Fri, 25 Mar 2022 23:42:29 -0000
5 -- Debian Janitor <janitor@jelmer.uk> Sat, 28 May 2022 03:34:40 -0000
56
67 golang-github-datadog-datadog-go (2.1.0-3) unstable; urgency=medium
78
66 "testing"
77
88 "github.com/stretchr/testify/assert"
9 "github.com/stretchr/testify/require"
910 )
1011
1112 func TestAggregatorSample(t *testing.T) {
191192 },
192193 },
193194 metrics)
194
195195 }
196196
197197 func TestAggregatorFlushConcurrency(t *testing.T) {
224224 }
225225
226226 wg.Wait()
227 }
228
229 func TestAggregatorTagsCopy(t *testing.T) {
230 a := newAggregator(nil)
231 tags := []string{"tag1", "tag2"}
232
233 a.gauge("gauge", 21, tags)
234 a.count("count", 21, tags)
235 a.set("set", "test", tags)
236
237 tags[0] = "new_tags"
238
239 metrics := a.flushMetrics()
240 require.Len(t, metrics, 3)
241 for _, m := range metrics {
242 assert.Equal(t, []string{"tag1", "tag2"}, m.tags)
243 }
227244 }
228245
229246 func TestGetContextAndTags(t *testing.T) {
2222 return &countMetric{
2323 value: value,
2424 name: name,
25 tags: tags,
25 tags: copySlice(tags),
2626 }
2727 }
2828
5252 return &gaugeMetric{
5353 value: math.Float64bits(value),
5454 name: name,
55 tags: tags,
55 tags: copySlice(tags),
5656 }
5757 }
5858
8383 set := &setMetric{
8484 data: map[string]struct{}{},
8585 name: name,
86 tags: tags,
86 tags: copySlice(tags),
8787 }
8888 set.data[value] = struct{}{}
8989 return set
1818 /*
1919 clientVersionTelemetryTag is a tag identifying this specific client version.
2020 */
21 var clientVersionTelemetryTag = "client_version:5.1.0"
21 var clientVersionTelemetryTag = "client_version:5.1.1"
2222
2323 // Telemetry represents internal metrics about the client behavior since it started.
2424 type Telemetry struct {
1818 }
1919 lock.Unlock()
2020 return true
21 }
2122
23 func copySlice(src []string) []string {
24 if src == nil {
25 return nil
26 }
27
28 c := make([]string, len(src))
29 copy(c, src)
30 return c
2231 }