diff options
Diffstat (limited to 'api/context.go')
-rw-r--r-- | api/context.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/api/context.go b/api/context.go index 07b6f5005..4042a7b0f 100644 --- a/api/context.go +++ b/api/context.go @@ -508,9 +508,18 @@ func Handle404(w http.ResponseWriter, r *http.Request) { } func GetSession(token string) *model.Session { + metrics := einterfaces.GetMetricsInterface() + var session *model.Session if ts, ok := sessionCache.Get(token); ok { session = ts.(*model.Session) + if metrics != nil { + metrics.IncrementMemCacheHitCounter("Session") + } + } else { + if metrics != nil { + metrics.IncrementMemCacheMissCounter("Session") + } } if session == nil { |