Skip to content

Commit

Permalink
statsd/datadog: add test for checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Feb 7, 2019
1 parent c0a3b1f commit 32187b3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions stats/datadog/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func TestDataDog(t *testing.T) {
myGauge := stats.New("my_gauge", stats.Gauge)
myTrend := stats.New("my_trend", stats.Trend)
myRate := stats.New("my_rate", stats.Rate)
myCheck := stats.New("my_check", stats.Rate)
var testMatrix = []struct {
input []stats.SampleContainer
output string
Expand Down Expand Up @@ -107,6 +108,21 @@ func TestDataDog(t *testing.T) {
},
output: "testing.things.my_rate:15|c|#tag1:value1",
},
{
input: []stats.SampleContainer{
newSample(myCheck, 16, map[string]string{
"tag1": "value1",
"tag3": "value3",
"check": "max<100",
}),
newSample(myCheck, 0, map[string]string{
"tag1": "value1",
"tag3": "value3",
"check": "max>100",
}),
},
output: "testing.things.my_check:16|c|#tag1:value1\ntesting.things.my_check:0|c|#tag1:value1",
},
}
for _, test := range testMatrix {
collector.Collect(test.input)
Expand Down

0 comments on commit 32187b3

Please sign in to comment.