diff options
author | Corey Hulen <corey@hulen.com> | 2017-03-06 10:15:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-06 10:15:37 -0500 |
commit | 847c716ea2f16f7673e9b6df344dd8432d5afe5e (patch) | |
tree | bf1ab536e2fd6bd54c95dd897974f20235e9b5c1 | |
parent | ca6f364d70619a11c6d89472d20a8b23182c492a (diff) | |
download | chat-847c716ea2f16f7673e9b6df344dd8432d5afe5e.tar.gz chat-847c716ea2f16f7673e9b6df344dd8432d5afe5e.tar.bz2 chat-847c716ea2f16f7673e9b6df344dd8432d5afe5e.zip |
Example of how to call metrics (#5621)
-rw-r--r-- | app/session.go | 6 | ||||
-rw-r--r-- | einterfaces/metrics.go | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/app/session.go b/app/session.go index 2207ed869..9e4fda4bd 100644 --- a/app/session.go +++ b/app/session.go @@ -4,10 +4,10 @@ package app import ( - "net/http" "github.com/mattermost/platform/einterfaces" "github.com/mattermost/platform/model" "github.com/mattermost/platform/utils" + "net/http" l4g "github.com/alecthomas/log4go" ) @@ -33,11 +33,11 @@ func GetSession(token string) (*model.Session, *model.AppError) { if ts, ok := sessionCache.Get(token); ok { session = ts.(*model.Session) if metrics != nil { - metrics.IncrementMemCacheHitCounter("Session") + metrics.IncrementMemCacheHitCounterSession() } } else { if metrics != nil { - metrics.IncrementMemCacheMissCounter("Session") + metrics.IncrementMemCacheMissCounterSession() } } diff --git a/einterfaces/metrics.go b/einterfaces/metrics.go index e11fd23a0..cc2eea97c 100644 --- a/einterfaces/metrics.go +++ b/einterfaces/metrics.go @@ -29,6 +29,8 @@ type MetricsInterface interface { IncrementMemCacheHitCounter(cacheName string) IncrementMemCacheMissCounter(cacheName string) + IncrementMemCacheMissCounterSession() + IncrementMemCacheHitCounterSession() IncrementWebsocketEvent(eventType string) |