summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2018-03-05 10:35:26 -0500
committerGitHub <noreply@github.com>2018-03-05 10:35:26 -0500
commit4a1802c039a0db2d97e8351c462963a99da857bf (patch)
treef083e9cd2c21434a6eba2dca7f90c127514bf727 /app
parentfbff94f3be1bf596f2b94f593687d3b162413de9 (diff)
downloadchat-4a1802c039a0db2d97e8351c462963a99da857bf.tar.gz
chat-4a1802c039a0db2d97e8351c462963a99da857bf.tar.bz2
chat-4a1802c039a0db2d97e8351c462963a99da857bf.zip
MM-9664 Add invalidation metrics for store caches (#8340)
* Add invalidation metrics for store caches * Increment session invalidation metric * Fix tests
Diffstat (limited to 'app')
-rw-r--r--app/admin.go10
-rw-r--r--app/session.go3
2 files changed, 8 insertions, 5 deletions
diff --git a/app/admin.go b/app/admin.go
index 154fa8899..22928390e 100644
--- a/app/admin.go
+++ b/app/admin.go
@@ -15,7 +15,6 @@ import (
l4g "github.com/alecthomas/log4go"
"github.com/mattermost/mattermost-server/model"
- "github.com/mattermost/mattermost-server/store/sqlstore"
"github.com/mattermost/mattermost-server/utils"
)
@@ -141,10 +140,11 @@ func (a *App) InvalidateAllCachesSkipSend() {
l4g.Info(utils.T("api.context.invalidate_all_caches"))
a.sessionCache.Purge()
ClearStatusCache()
- sqlstore.ClearChannelCaches()
- sqlstore.ClearUserCaches()
- sqlstore.ClearPostCaches()
- sqlstore.ClearWebhookCaches()
+ a.Srv.Store.Channel().ClearCaches()
+ a.Srv.Store.User().ClearCaches()
+ a.Srv.Store.Post().ClearCaches()
+ a.Srv.Store.FileInfo().ClearCaches()
+ a.Srv.Store.Webhook().ClearCaches()
a.LoadLicense()
}
diff --git a/app/session.go b/app/session.go
index 459618439..88f52477f 100644
--- a/app/session.go
+++ b/app/session.go
@@ -138,6 +138,9 @@ func (a *App) ClearSessionCacheForUserSkipClusterSend(userId string) {
session := ts.(*model.Session)
if session.UserId == userId {
a.sessionCache.Remove(key)
+ if a.Metrics != nil {
+ a.Metrics.IncrementMemCacheInvalidationCounterSession()
+ }
}
}
}