Skip to content

Commit c00d9ae

Browse files
change dispatchEvent to snapshotEvent.
1 parent 213efab commit c00d9ae

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

optimizely/event/events.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ type VisitorAttribute struct {
7070
}
7171

7272
type Snapshot struct {
73-
Decisions []Decision `json:"decisions"`
74-
Events []DispatchEvent `json:"events"`
73+
Decisions []Decision `json:"decisions"`
74+
Events []SnapshotEvent `json:"events"`
7575
}
7676

7777
type Decision struct {
@@ -80,7 +80,7 @@ type Decision struct {
8080
ExperimentID string `json:"experiment_id"`
8181
}
8282

83-
type DispatchEvent struct {
83+
type SnapshotEvent struct {
8484
EntityID string `json:"entity_id"`
8585
Key string `json:"key"`
8686
Timestamp int64 `json:"timestamp"`

optimizely/event/factory.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ func createImpressionBatchEvent(userEvent UserEvent) EventBatch {
7777
decision.ExperimentID = userEvent.Impression.ExperimentID
7878
decision.VariationID = userEvent.Impression.VariationID
7979

80-
dispatchEvent := DispatchEvent{}
80+
dispatchEvent := SnapshotEvent{}
8181
dispatchEvent.Timestamp = makeTimestamp()
8282
dispatchEvent.Key = userEvent.Impression.Key
8383
dispatchEvent.EntityID = userEvent.Impression.EntityID
8484
dispatchEvent.Uuid = guuid.New().String()
8585
dispatchEvent.Tags = make(map[string]interface{})
8686

87-
return createBatchEvent(userEvent, userEvent.Impression.Attributes, [] Decision{decision}, []DispatchEvent{dispatchEvent})
87+
return createBatchEvent(userEvent, userEvent.Impression.Attributes, [] Decision{decision}, []SnapshotEvent{dispatchEvent})
8888

8989
}
9090

@@ -127,7 +127,7 @@ func CreateConversionUserEvent(context EventContext, event entities.Event, userC
127127
}
128128
func createConversionBatchEvent(userEvent UserEvent) EventBatch {
129129

130-
dispatchEvent := DispatchEvent{}
130+
dispatchEvent := SnapshotEvent{}
131131
dispatchEvent.Timestamp = makeTimestamp()
132132
dispatchEvent.Key = userEvent.Conversion.Key
133133
dispatchEvent.EntityID = userEvent.Conversion.EntityID
@@ -140,12 +140,12 @@ func createConversionBatchEvent(userEvent UserEvent) EventBatch {
140140
dispatchEvent.Value = userEvent.Conversion.Value
141141
}
142142

143-
return createBatchEvent(userEvent, userEvent.Conversion.Attributes, [] Decision{}, []DispatchEvent{dispatchEvent})
143+
return createBatchEvent(userEvent, userEvent.Conversion.Attributes, [] Decision{}, []SnapshotEvent{dispatchEvent})
144144
}
145145

146146
func createBatchEvent(userEvent UserEvent, attributes []VisitorAttribute,
147147
decisions []Decision,
148-
dispatchEvents []DispatchEvent) EventBatch {
148+
dispatchEvents []SnapshotEvent) EventBatch {
149149

150150
snapShot := Snapshot{}
151151
snapShot.Decisions = decisions
@@ -202,4 +202,4 @@ func getEventAttributes(attributeKeyToIdMap map[string]string, attributes map[st
202202
eventAttributes = append(eventAttributes, attribute)
203203

204204
return eventAttributes
205-
}
205+
}

optimizely/event/factory_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ func TestCreateConversionEventRevenue(t *testing.T) {
130130
assert.Equal(t, 25.1, *batch.Visitors[0].Snapshots[0].Events[0].Value)
131131

132132

133-
}
133+
}

optimizely/event/processor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ func TestDefaultEventProcessor_ProcessImpressions(t *testing.T) {
5353
assert.Equal(t, true, false)
5454
}
5555

56-
}
56+
}

optimizely/event/queue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ func (i *InMemoryQueue) Size() int {
5252
func NewInMemoryQueue(queueSize int) Queue {
5353
i := &InMemoryQueue{Queue:make([] interface{}, 0, queueSize)}
5454
return i
55-
}
55+
}

0 commit comments

Comments
 (0)