Skip to content

Commit

Permalink
caduceus: change event_type to event
Browse files Browse the repository at this point in the history
  • Loading branch information
githubsands committed Mar 20, 2019
1 parent 6ea64e6 commit 4a64478
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/caduceus/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func Metrics() []xmetrics.Metric {
Name: IncomingEventTypeCounter,
Help: "Incoming count of events by event type",
Type: "counter",
LabelNames: []string{"event_type"},
LabelNames: []string{"event"},
},
}
}
2 changes: 1 addition & 1 deletion src/caduceus/senderWrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (sw *CaduceusSenderWrapper) Update(list []webhook.W) {
func (sw *CaduceusSenderWrapper) Queue(msg *wrp.Message) {
sw.mutex.RLock()

sw.eventType.With("event_type", msg.FindEventStringSubMatch())
sw.eventType.With("event", msg.FindEventStringSubMatch())

for _, v := range sw.senders {
v.Queue(msg)
Expand Down
8 changes: 4 additions & 4 deletions src/caduceus/senderWrapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ func getFakeFactory() *SenderWrapperFactory {
On("With", []string{"url", "http://localhost:9999/foo", "reason", "invalid_config"}).Return(fakeIgnore).
On("With", []string{"url", "http://localhost:8888/foo", "code", "200", "event", "unknown"}).Return(fakeIgnore).
On("With", []string{"url", "http://localhost:9999/foo", "code", "200", "event", "unknown"}).Return(fakeIgnore).
On("With", []string{"event_type", "iot"}).Return(fakeIgnore).
On("With", []string{"event_type", "test/extra-stuff"}).Return(fakeIgnore).
On("With", []string{"event_type", "bob/magic/dog"}).Return(fakeIgnore).
On("With", []string{"event_type", "unknown"}).Return(fakeIgnore)
On("With", []string{"event", "iot"}).Return(fakeIgnore).
On("With", []string{"event", "test/extra-stuff"}).Return(fakeIgnore).
On("With", []string{"event", "bob/magic/dog"}).Return(fakeIgnore).
On("With", []string{"event", "unknown"}).Return(fakeIgnore)

fakeRegistry := new(mockCaduceusMetricsRegistry)
fakeRegistry.On("NewCounter", DropsDueToInvalidPayload).Return(fakeDDTIP)
Expand Down

0 comments on commit 4a64478

Please sign in to comment.