Skip to content

Commit

Permalink
Merge 72ccda8 into 56b8e59
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaszurkan-optimizely committed Nov 7, 2019
2 parents 56b8e59 + 72ccda8 commit 366ae4e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
Changes that have landed but are not yet released. Changes that have landed but are not yet released.

## [1.0.0-beta6] - November 7th, 2019

## New Features

- Experiment override service - implement groups
[#164](https://github.com/optimizely/go-sdk/pull/164)
- Add User profile service
[#163](https://github.com/optimizely/go-sdk/pull/163)

### Bug Fixes
- Fix config managers so that they don't try and parse on error returned from CDN. [#170](https://github.com/optimizely/go-sdk/pull/170)
- When event batch size has been reached only start one batch event processing go routine.
- When queue size is met, log a message and do not add to the queue.
- Duration used was setting the time too far into the future by multiplying by second and then by milliseconds. Flush interval is now any duration, default is 30 seconds. If you don't pass in a multiplier the duration created is in microseconds.
[#167](https://github.com/optimizely/go-sdk/pull/167)
- fixed parsing for audience conditions.
[#165] (https://github.com/optimizely/go-sdk/pull/165)
- Check nil to prevent panic. [#162] (https://github.com/optimizely/go-sdk/pull/162)
- fix: support audience ids. [#161] (https://github.com/optimizely/go-sdk/pull/161)

## [1.0.0-beta5] - October 30th, 2019

### Bug Fixes
Expand Down
8 changes: 6 additions & 2 deletions pkg/event/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,12 @@ func NewBatchEventProcessor(options ...BPOptionConfig) *BatchEventProcessor {
}

if p.BatchSize > p.MaxQueueSize {
pLogger.Warning("Batch size is larger than queue size. Swapping")
p.BatchSize, p.MaxQueueSize = p.MaxQueueSize, p.BatchSize
pLogger.Warning(
fmt.Sprintf("Batch size %d is larger than queue size %d. Setting to defaults",
p.BatchSize, p.MaxQueueSize))

p.BatchSize = DefaultBatchSize
p.MaxQueueSize = defaultQueueSize
}

if p.Q == nil {
Expand Down
10 changes: 6 additions & 4 deletions pkg/event/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ func TestDefaultEventProcessor_BatchSizeLessThanQSize(t *testing.T) {
WithQueue(NewInMemoryQueue(100)),
WithEventDispatcher(NewMockDispatcher(100, false)))

assert.Equal(t, 2, processor.BatchSize)
assert.Equal(t, 10, processor.MaxQueueSize)
assert.Equal(t, DefaultBatchSize, processor.BatchSize)
assert.Equal(t, defaultQueueSize, processor.MaxQueueSize)

}

Expand Down Expand Up @@ -408,8 +408,10 @@ func TestChanQueueEventProcessor_ProcessImpression(t *testing.T) {

func TestChanQueueEventProcessor_ProcessBatch(t *testing.T) {
exeCtx := utils.NewCancelableExecutionCtx()
processor := NewBatchEventProcessor(WithQueueSize(100), WithFlushInterval(100),
WithQueue(NewInMemoryQueue(100)), WithEventDispatcher(NewMockDispatcher(100, false)))
processor := NewBatchEventProcessor(
WithQueueSize(100),
WithQueue(NewInMemoryQueue(100)),
WithEventDispatcher(NewMockDispatcher(100, false)))
processor.Start(exeCtx)

impression := BuildTestImpressionEvent()
Expand Down

0 comments on commit 366ae4e

Please sign in to comment.