From d6be4bc35c583e1e8270973ade3a0add36d04856 Mon Sep 17 00:00:00 2001 From: Pawel Szczodruch Date: Mon, 2 Mar 2020 11:35:47 -0800 Subject: [PATCH 1/7] fix: instantiate event processor with dispatcher --- pkg/event/processor.go | 14 +++++++------- pkg/event/processor_test.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/event/processor.go b/pkg/event/processor.go index 817b437e2..4ca9e67bc 100644 --- a/pkg/event/processor.go +++ b/pkg/event/processor.go @@ -154,18 +154,18 @@ func NewBatchEventProcessor(options ...BPOptionConfig) *BatchEventProcessor { p.Q = NewInMemoryQueue(p.MaxQueueSize) } - return p -} - -// Start initializes the event processor -func (p *BatchEventProcessor) Start(ctx context.Context) { if p.EventDispatcher == nil { dispatcher := NewQueueEventDispatcher(p.metricsRegistry) - defer dispatcher.flushEvents() p.EventDispatcher = dispatcher } - pLogger.Debug("Batch event processor started") + return p +} + +// Start does not do any initialization, just starts the ticker +func (p *BatchEventProcessor) Start(ctx context.Context) { + + pLogger.Info("Batch event processor started") p.startTicker(ctx) } diff --git a/pkg/event/processor_test.go b/pkg/event/processor_test.go index 5d408579f..bb1a478c8 100644 --- a/pkg/event/processor_test.go +++ b/pkg/event/processor_test.go @@ -65,7 +65,7 @@ func newExecutionContext() *utils.ExecGroup { func TestDefaultEventProcessor_ProcessImpression(t *testing.T) { eg := newExecutionContext() processor := NewBatchEventProcessor() - processor.EventDispatcher = nil + processor.EventDispatcher = NewQueueEventDispatcher(processor.metricsRegistry) eg.Go(processor.Start) impression := BuildTestImpressionEvent() From c448063b003d407a83cf99c2198b10375e7e14b9 Mon Sep 17 00:00:00 2001 From: Pawel Szczodruch Date: Mon, 2 Mar 2020 13:49:55 -0800 Subject: [PATCH 2/7] download specific version of murmur --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 3bd0f3772..3bc2862c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,8 @@ jobs: # This pkg not in go 1.8 - go get github.com/stretchr/testify - pushd $GOPATH/src/github.com/stretchr/testify && git checkout v1.4.0 && popd + - go get github.com/twmb/murmur3 + - pushd $GOPATH/src/github.com/twmb/murmur3 && git checkout v1.0.0 && popd # -coverprofile was not introduced in 1.8 - make test From 3c78272475fdad2bc898e67471329c6c02607706 Mon Sep 17 00:00:00 2001 From: Pawel Szczodruch Date: Mon, 2 Mar 2020 14:00:47 -0800 Subject: [PATCH 3/7] correcting travis --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3bc2862c6..83e971738 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,12 +53,12 @@ jobs: - mkdir -p $GOPATH/src/github.com && pushd $GOPATH/src/github.com && ln -s $HOME/build/optimizely optimizely && popd script: # Need to download packages explicitly + - go get github.com/twmb/murmur3 + - pushd $GOPATH/src/github.com/twmb/murmur3 && git checkout v1.0.0 && popd - go get -v -d ./... # This pkg not in go 1.8 - go get github.com/stretchr/testify - pushd $GOPATH/src/github.com/stretchr/testify && git checkout v1.4.0 && popd - - go get github.com/twmb/murmur3 - - pushd $GOPATH/src/github.com/twmb/murmur3 && git checkout v1.0.0 && popd # -coverprofile was not introduced in 1.8 - make test From 327e0c2c27a4a366a87cbe401cca831404e618f3 Mon Sep 17 00:00:00 2001 From: Pawel Szczodruch Date: Mon, 2 Mar 2020 14:33:53 -0800 Subject: [PATCH 4/7] downloading only --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 83e971738..9cad668f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ jobs: - mkdir -p $GOPATH/src/github.com && pushd $GOPATH/src/github.com && ln -s $HOME/build/optimizely optimizely && popd script: # Need to download packages explicitly - - go get github.com/twmb/murmur3 + - go get -d github.com/twmb/murmur3 - pushd $GOPATH/src/github.com/twmb/murmur3 && git checkout v1.0.0 && popd - go get -v -d ./... # This pkg not in go 1.8 From e1d821f545f8dbe8056baa1d26e6ba6d536b79e4 Mon Sep 17 00:00:00 2001 From: Pawel Szczodruch Date: Mon, 2 Mar 2020 15:18:09 -0800 Subject: [PATCH 5/7] try again --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9cad668f5..bfbaba806 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ jobs: - mkdir -p $GOPATH/src/github.com && pushd $GOPATH/src/github.com && ln -s $HOME/build/optimizely optimizely && popd script: # Need to download packages explicitly - - go get -d github.com/twmb/murmur3 + - go get -f -u github.com/twmb/murmur3 - pushd $GOPATH/src/github.com/twmb/murmur3 && git checkout v1.0.0 && popd - go get -v -d ./... # This pkg not in go 1.8 From 15cbd5c512c7a5e01732d55eb8684433ad6e5a2a Mon Sep 17 00:00:00 2001 From: Pawel Szczodruch Date: Mon, 2 Mar 2020 15:26:02 -0800 Subject: [PATCH 6/7] another try --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bfbaba806..007939cc6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ jobs: - mkdir -p $GOPATH/src/github.com && pushd $GOPATH/src/github.com && ln -s $HOME/build/optimizely optimizely && popd script: # Need to download packages explicitly - - go get -f -u github.com/twmb/murmur3 + - mkdir $GOPATH/src/github.com/twmb && cd $GOPATH/src/github.com/twmb && git clone https://github.com/twmb/murmur3.git - pushd $GOPATH/src/github.com/twmb/murmur3 && git checkout v1.0.0 && popd - go get -v -d ./... # This pkg not in go 1.8 From 616e3f5372ff96e26261050e3fb6b3b03b99e88a Mon Sep 17 00:00:00 2001 From: Pawel Szczodruch Date: Mon, 2 Mar 2020 16:04:18 -0800 Subject: [PATCH 7/7] another try --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 007939cc6..0b8e64ff9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ jobs: - mkdir -p $GOPATH/src/github.com && pushd $GOPATH/src/github.com && ln -s $HOME/build/optimizely optimizely && popd script: # Need to download packages explicitly - - mkdir $GOPATH/src/github.com/twmb && cd $GOPATH/src/github.com/twmb && git clone https://github.com/twmb/murmur3.git + - mkdir $GOPATH/src/github.com/twmb && cd $GOPATH/src/github.com/twmb && git clone https://github.com/twmb/murmur3.git && cd $TRAVIS_BUILD_DIR - pushd $GOPATH/src/github.com/twmb/murmur3 && git checkout v1.0.0 && popd - go get -v -d ./... # This pkg not in go 1.8