@@ -49,15 +49,15 @@ var MetricSinkTests = []struct {
4949 PropagateHostname bool
5050 Expected string
5151}{
52- {"SetGauge " , []string {"foo" , "bar" }, float32 (42 ), EmptyTags , HostnameDisabled , "foo.bar:42|g" },
53- {"SetGauge " , []string {"foo" , "bar" , "baz" }, float32 (42 ), EmptyTags , HostnameDisabled , "foo.bar.baz:42|g" },
54- {"AddSample " , []string {"sample" , "thing" }, float32 (4 ), EmptyTags , HostnameDisabled , "sample.thing:4.000000|ms" },
55- {"IncrCounter " , []string {"count" , "me" }, float32 (3 ), EmptyTags , HostnameDisabled , "count.me:3|c" },
56-
57- {"SetGauge " , []string {"foo" , "baz" }, float32 (42 ), []metrics.Label {{"my_tag" , "" }}, HostnameDisabled , "foo.baz:42|g|#my_tag" },
58- {"SetGauge " , []string {"foo" , "baz" }, float32 (42 ), []metrics.Label {{"my tag" , "my_value" }}, HostnameDisabled , "foo.baz:42|g|#my_tag:my_value" },
59- {"SetGauge " , []string {"foo" , "bar" }, float32 (42 ), []metrics.Label {{"my_tag" , "my_value" }, {"other_tag" , "other_value" }}, HostnameDisabled , "foo.bar:42|g|#my_tag:my_value,other_tag:other_value" },
60- {"SetGauge " , []string {"foo" , "bar" }, float32 (42 ), []metrics.Label {{"my_tag" , "my_value" }, {"other_tag" , "other_value" }}, HostnameEnabled , "foo.bar:42|g|#my_tag:my_value,other_tag:other_value,host:test_hostname" },
52+ {"SetGaugeWithLabels " , []string {"foo" , "bar" }, float32 (42 ), EmptyTags , HostnameDisabled , "foo.bar:42|g" },
53+ {"SetGaugeWithLabels " , []string {"foo" , "bar" , "baz" }, float32 (42 ), EmptyTags , HostnameDisabled , "foo.bar.baz:42|g" },
54+ {"AddSampleWithLabels " , []string {"sample" , "thing" }, float32 (4 ), EmptyTags , HostnameDisabled , "sample.thing:4.000000|ms" },
55+ {"IncrCounterWithLabels " , []string {"count" , "me" }, float32 (3 ), EmptyTags , HostnameDisabled , "count.me:3|c" },
56+
57+ {"SetGaugeWithLabels " , []string {"foo" , "baz" }, float32 (42 ), []metrics.Label {{"my_tag" , "" }}, HostnameDisabled , "foo.baz:42|g|#my_tag" },
58+ {"SetGaugeWithLabels " , []string {"foo" , "baz" }, float32 (42 ), []metrics.Label {{"my tag" , "my_value" }}, HostnameDisabled , "foo.baz:42|g|#my_tag:my_value" },
59+ {"SetGaugeWithLabels " , []string {"foo" , "bar" }, float32 (42 ), []metrics.Label {{"my_tag" , "my_value" }, {"other_tag" , "other_value" }}, HostnameDisabled , "foo.bar:42|g|#my_tag:my_value,other_tag:other_value" },
60+ {"SetGaugeWithLabels " , []string {"foo" , "bar" }, float32 (42 ), []metrics.Label {{"my_tag" , "my_value" }, {"other_tag" , "other_value" }}, HostnameEnabled , "foo.bar:42|g|#my_tag:my_value,other_tag:other_value,host:test_hostname" },
6161}
6262
6363func mockNewDogStatsdSink (addr string , labels []metrics.Label , tagWithHostname bool ) * DogStatsdSink {
@@ -117,7 +117,8 @@ func TestMetricSink(t *testing.T) {
117117 method := reflect .ValueOf (dog ).MethodByName (tt .Method )
118118 method .Call ([]reflect.Value {
119119 reflect .ValueOf (tt .Metric ),
120- reflect .ValueOf (tt .Value )})
120+ reflect .ValueOf (tt .Value ),
121+ reflect .ValueOf ([]metrics.Label {})})
121122 assertServerMatchesExpected (t , server , buf , tt .Expected )
122123 })
123124 }
0 commit comments