Example of how to call metrics (#5621)
Этот коммит содержится в:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ type MetricsInterface interface {
|
||||
|
||||
IncrementMemCacheHitCounter(cacheName string)
|
||||
IncrementMemCacheMissCounter(cacheName string)
|
||||
IncrementMemCacheMissCounterSession()
|
||||
IncrementMemCacheHitCounterSession()
|
||||
|
||||
IncrementWebsocketEvent(eventType string)
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user