Use strings.Join in statsd input (#2947)
This commit is contained in:
parent
41b6445eb2
commit
2c61e5d3a5
|
@ -475,10 +475,11 @@ func (s *Statsd) parseStatsdLine(line string) error {
|
|||
// Make a unique key for the measurement name/tags
|
||||
var tg []string
|
||||
for k, v := range m.tags {
|
||||
tg = append(tg, fmt.Sprintf("%s=%s", k, v))
|
||||
tg = append(tg, k+"="+v)
|
||||
}
|
||||
sort.Strings(tg)
|
||||
m.hash = fmt.Sprintf("%s%s", strings.Join(tg, ""), m.name)
|
||||
tg = append(tg, m.name)
|
||||
m.hash = strings.Join(tg, "")
|
||||
|
||||
s.aggregate(m)
|
||||
}
|
||||
|
|
|
@ -929,7 +929,7 @@ func TestParse_MeasurementsWithMultipleValues(t *testing.T) {
|
|||
// plus the last bit of value 1
|
||||
// which adds up to 12 individual datapoints to be cached
|
||||
if cachedtiming.fields[defaultFieldName].n != 12 {
|
||||
t.Errorf("Expected 11 additions, got %d", cachedtiming.fields[defaultFieldName].n)
|
||||
t.Errorf("Expected 12 additions, got %d", cachedtiming.fields[defaultFieldName].n)
|
||||
}
|
||||
|
||||
if cachedtiming.fields[defaultFieldName].upper != 1 {
|
||||
|
|
Loading…
Reference in New Issue