From d8e28f69c1a9b3cc8a227e70f7d81ff797eaf018 Mon Sep 17 00:00:00 2001 From: Vadim Alekseev Date: Mon, 31 Jul 2023 19:22:28 +0300 Subject: [PATCH] Remove unused bench --- plugin/input/journalctl/commiter.go | 4 ---- plugin/input/journalctl/journalctl_test.go | 28 ---------------------- 2 files changed, 32 deletions(-) diff --git a/plugin/input/journalctl/commiter.go b/plugin/input/journalctl/commiter.go index 8a129000b..5973964c9 100644 --- a/plugin/input/journalctl/commiter.go +++ b/plugin/input/journalctl/commiter.go @@ -60,10 +60,6 @@ func (a *AsyncCommiter) Commit(event *pipeline.Event) { a.Lock() defer a.Unlock() - if !a.debouncer.Ready() { - return - } - a.debouncer.Do(func() { a.save(offInfo) }) diff --git a/plugin/input/journalctl/journalctl_test.go b/plugin/input/journalctl/journalctl_test.go index a25882337..923d157af 100644 --- a/plugin/input/journalctl/journalctl_test.go +++ b/plugin/input/journalctl/journalctl_test.go @@ -3,19 +3,16 @@ package journalctl import ( - "path" "path/filepath" "strings" "sync" "testing" - "time" "github.com/ozontech/file.d/cfg" "github.com/ozontech/file.d/pipeline" "github.com/ozontech/file.d/plugin/output/devnull" "github.com/ozontech/file.d/test" "github.com/stretchr/testify/assert" - insaneJSON "github.com/vitkovskii/insane-json" ) func setInput(p *pipeline.Pipeline, config *Config) { @@ -110,28 +107,3 @@ func TestOffsets(t *testing.T) { assert.Equal(t, 1, cnt) } } - -func BenchmarkName(b *testing.B) { - p := Plugin{config: &Config{ - OffsetsFile: path.Join(b.TempDir(), "offsets.yaml"), - }} - p.commiter = NewSyncCommiter(p.sync) - - event := &pipeline.Event{Root: insaneJSON.Spawn()} - defer insaneJSON.Release(event.Root) - - p.config.PersistenceMode_ = persistenceModeSync - b.Run("sync", func(b *testing.B) { - for i := 0; i < b.N; i++ { - p.Commit(event) - } - }) - - p.commiter = NewAsyncCommiter(NewDebouncer(time.Second), p.sync) - p.config.PersistenceMode_ = persistenceModeAsync - b.Run("async", func(b *testing.B) { - for i := 0; i < b.N; i++ { - p.Commit(event) - } - }) -}