perf(agent): Reduce complexity of creating new metrics to 'O(N_fields)' (#15889)
This commit is contained in:
parent
e6d82bd996
commit
ccdbc4c480
|
|
@ -56,7 +56,8 @@ func New(
|
|||
if v == nil {
|
||||
continue
|
||||
}
|
||||
m.AddField(k, v)
|
||||
|
||||
m.MetricFields = append(m.MetricFields, &telegraf.Field{Key: k, Value: v})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue