Use non-allocating field and tag accessors in datadog output (#4803)

This commit is contained in:
Kevin Conaway
2018-10-05 16:48:18 -04:00
committed by Daniel Nelson
parent 030f944505
commit 422c142463
2 changed files with 31 additions and 18 deletions

View File

@@ -74,19 +74,33 @@ func TestAuthenticatedUrl(t *testing.T) {
func TestBuildTags(t *testing.T) {
var tagtests = []struct {
ptIn map[string]string
ptIn []*telegraf.Tag
outTags []string
}{
{
map[string]string{"one": "two", "three": "four"},
[]*telegraf.Tag{
&telegraf.Tag{
Key: "one",
Value: "two",
},
&telegraf.Tag{
Key: "three",
Value: "four",
},
},
[]string{"one:two", "three:four"},
},
{
map[string]string{"aaa": "bbb"},
[]*telegraf.Tag{
&telegraf.Tag{
Key: "aaa",
Value: "bbb",
},
},
[]string{"aaa:bbb"},
},
{
map[string]string{},
[]*telegraf.Tag{},
[]string{},
},
}