Adding metrics for caching mechanisms (#4828)

Этот коммит содержится в:
Christopher Speller
2016-12-19 10:16:22 -05:00
коммит произвёл GitHub
родитель 6a5cdd5cdf
Коммит f96173528f
14 изменённых файлов: 113 добавлений и 22 удалений

Просмотреть файл

@@ -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 {