Adding websocket event metrics (#5342)

This commit is contained in:
Christopher Speller
2017-02-10 10:01:08 -05:00
committed by Corey Hulen
parent 1bbed1cb2b
commit 9934954d18
2 changed files with 6 additions and 0 deletions

View File

@@ -86,6 +86,10 @@ func HubUnregister(webConn *WebConn) {
}
func Publish(message *model.WebSocketEvent) {
if metrics := einterfaces.GetMetricsInterface(); metrics != nil {
metrics.IncrementWebsocketEvent(message.Event)
}
message.DoPreComputeJson()
for _, hub := range hubs {
hub.Broadcast(message)

View File

@@ -26,6 +26,8 @@ type MetricsInterface interface {
IncrementMemCacheHitCounter(cacheName string)
IncrementMemCacheMissCounter(cacheName string)
IncrementWebsocketEvent(eventType string)
AddMemCacheHitCounter(cacheName string, amount float64)
AddMemCacheMissCounter(cacheName string, amount float64)
}