Skip to content

Commit

Permalink
Improving statsd reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Hahn committed Jan 17, 2018
1 parent 1234c88 commit cf84370
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion extensions/apns_message_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ var _ = FDescribe("APNS Message Handler", func() {
handler.handleAPNSResponse(res)

Expect(mockStatsDClient.Count["failed"]).To(Equal(2))
Expect(mockStatsDClient.Count["missing-device-token"]).To(Equal(2))
})
})

Expand Down
3 changes: 1 addition & 2 deletions extensions/datadog_statsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ func (s *StatsD) HandleNotificationSuccess(game string, platform string) {

//HandleNotificationFailure stores each type of failure
func (s *StatsD) HandleNotificationFailure(game string, platform string, err *errors.PushError) {
s.Client.Incr("failed", []string{fmt.Sprintf("platform:%s", platform), fmt.Sprintf("game:%s", game)}, 1)
s.Client.Incr(err.Key, []string{fmt.Sprintf("platform:%s", platform), fmt.Sprintf("game:%s", game)}, 1)
s.Client.Incr("failed", []string{fmt.Sprintf("platform:%s", platform), fmt.Sprintf("game:%s", game), fmt.Sprintf("reason:%s", err.Key)}, 1)
}

//ReportGoStats reports go stats in statsd
Expand Down
1 change: 0 additions & 1 deletion extensions/datadog_statsd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ var _ = Describe("StatsD Extension", func() {
statsd.HandleNotificationFailure("game", "apns", pErr)

Expect(mockClient.Count["failed"]).To(Equal(2))
Expect(mockClient.Count["some-key"]).To(Equal(2))
})
})
})
Expand Down
1 change: 0 additions & 1 deletion extensions/gcm_message_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ var _ = Describe("GCM Message Handler", func() {
handler.handleGCMResponse(res)

Expect(mockStatsDClient.Count["failed"]).To(Equal(2))
Expect(mockStatsDClient.Count["device_unregistered"]).To(Equal(2))
})
})

Expand Down

0 comments on commit cf84370

Please sign in to comment.