Skip to content

Commit

Permalink
after review
Browse files Browse the repository at this point in the history
  • Loading branch information
DSmolonogov committed Oct 27, 2022
1 parent 7af8c1d commit b128d79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions plugin/action/discard/discard.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package discard

import (
"time"

"github.com/ozontech/file.d/fd"
"github.com/ozontech/file.d/pipeline"
"github.com/ozontech/file.d/plugin"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"time"
)

/*{ introduction
Expand All @@ -26,7 +27,7 @@ pipelines:
}*/

const (
tickTime = 1 * time.Second
tickTime = time.Second
first = 1
)

Expand Down Expand Up @@ -55,7 +56,6 @@ func factory() (pipeline.AnyPlugin, pipeline.AnyConfig) {
func (p *Plugin) Start(config pipeline.AnyConfig, params *pipeline.ActionPluginParams) {
p.config = config.(*Config)

// new logger with sampler
p.logger = zap.New(
zapcore.NewSamplerWithOptions(params.Logger.Desugar().Core(), tickTime, first, p.config.Thereafter),
).Named("fd").Named("action").Named("discard").Sugar()
Expand Down
8 changes: 4 additions & 4 deletions plugin/action/discard/discard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestDiscardAnd(t *testing.T) {
},
}

p, input, output := test.NewPipelineMock(test.NewActionPluginStaticInfo(factory, nil, pipeline.MatchModeAnd, conds, false))
p, input, output := test.NewPipelineMock(test.NewActionPluginStaticInfo(factory, &Config{}, pipeline.MatchModeAnd, conds, false))

wg := &sync.WaitGroup{}
wg.Add(10)
Expand Down Expand Up @@ -66,7 +66,7 @@ func TestDiscardOr(t *testing.T) {
},
}

p, input, output := test.NewPipelineMock(test.NewActionPluginStaticInfo(factory, nil, pipeline.MatchModeOr, conds, false))
p, input, output := test.NewPipelineMock(test.NewActionPluginStaticInfo(factory, &Config{}, pipeline.MatchModeOr, conds, false))

wg := &sync.WaitGroup{}
wg.Add(8)
Expand Down Expand Up @@ -110,7 +110,7 @@ func TestDiscardRegex(t *testing.T) {
},
}

p, input, output := test.NewPipelineMock(test.NewActionPluginStaticInfo(factory, nil, pipeline.MatchModeOr, conds, false))
p, input, output := test.NewPipelineMock(test.NewActionPluginStaticInfo(factory, &Config{}, pipeline.MatchModeOr, conds, false))

wg := &sync.WaitGroup{}
wg.Add(11)
Expand Down Expand Up @@ -151,7 +151,7 @@ func TestDiscardMatchInvert(t *testing.T) {
},
}

p, input, output := test.NewPipelineMock(test.NewActionPluginStaticInfo(factory, nil, pipeline.MatchModeAnd, conds, true))
p, input, output := test.NewPipelineMock(test.NewActionPluginStaticInfo(factory, &Config{}, pipeline.MatchModeAnd, conds, true))

wg := &sync.WaitGroup{}
wg.Add(9)
Expand Down

0 comments on commit b128d79

Please sign in to comment.