Fixup some code based on feedback from @dgnorton
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
// applyFilter: if false, the above filter is not applied to each metric.
|
||||
// This is used by Aggregators, because aggregators use filters
|
||||
// on incoming metrics instead of on created metrics.
|
||||
// TODO refactor this to not have such a huge func signature.
|
||||
func makemetric(
|
||||
measurement string,
|
||||
fields map[string]interface{},
|
||||
|
||||
@@ -109,13 +109,6 @@ func (r *RunningAggregator) Run(
|
||||
acc telegraf.Accumulator,
|
||||
shutdown chan struct{},
|
||||
) {
|
||||
if r.Config.Delay == 0 {
|
||||
r.Config.Delay = time.Millisecond * 100
|
||||
}
|
||||
if r.Config.Period == 0 {
|
||||
r.Config.Period = time.Second * 30
|
||||
}
|
||||
|
||||
time.Sleep(r.Config.Delay)
|
||||
periodT := time.NewTicker(r.Config.Period)
|
||||
defer periodT.Stop()
|
||||
|
||||
@@ -20,6 +20,7 @@ func TestAdd(t *testing.T) {
|
||||
Filter: Filter{
|
||||
NamePass: []string{"*"},
|
||||
},
|
||||
Period: time.Millisecond * 500,
|
||||
})
|
||||
assert.NoError(t, ra.Config.Filter.Compile())
|
||||
acc := testutil.Accumulator{}
|
||||
|
||||
Reference in New Issue
Block a user