Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into mattkuzminski/incre…
Browse files Browse the repository at this point in the history
…ased-stats--flush-interval
  • Loading branch information
maciuszek committed Jan 9, 2025
2 parents 6b95ae4 + 5f2727b commit 7d38863
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func TestValidateTags(t *testing.T) {
store.Flush()

expected := "test:1|c"
counter := sink.record
if !strings.Contains(counter, expected) {
t.Error("wanted counter value of test:1|c, got", counter)
output := sink.record
if !strings.Contains(output, expected) && !strings.Contains(output, "reserved_tag") {
t.Errorf("Expected without reserved tags: '%s' Got: '%s'", expected, output)
}

// A reserved tag should trigger adding the reserved_tag counter
Expand All @@ -89,10 +89,11 @@ func TestValidateTags(t *testing.T) {
store.NewCounterWithTags("test", map[string]string{"host": "i"}).Inc()
store.Flush()

expected = "reserved_tag:1|c\ntest.__host=i:1|c"
counter = sink.record
if !strings.Contains(counter, expected) {
t.Error("wanted counter value of test.___f=i:1|c, got", counter)
expected = "test.__host=i:1|c"
expectedReservedTag := "reserved_tag:1|c"
output = sink.record
if !strings.Contains(output, expected) && !strings.Contains(output, expectedReservedTag) {
t.Errorf("Expected: '%s' and '%s', In: '%s'", expected, expectedReservedTag, output)
}
}

Expand Down

0 comments on commit 7d38863

Please sign in to comment.