MM-57193: Standardize the cache names (#26441)
We use the same name for hit/miss/invalidation metrics. The downside is that now we have conflated a full cache purge and a single cache key invalidation into a single label, but the advantage is that it's easier to monitor the usage of a single cache. And moreover, duplicating the same string across multiple places increases the chances of making a mistake. Centralizing the cache name only at instantiation simplifies the code. After this, we would be ready to use Redis. https://mattermost.atlassian.net/browse/MM-57193 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
53471c7e8c
Коммит
7679f51e3e
@@ -27,14 +27,14 @@ func (s LocalCacheWebhookStore) ClearCaches() {
|
||||
s.rootStore.doClearCacheCluster(s.rootStore.webhookCache)
|
||||
|
||||
if s.rootStore.metrics != nil {
|
||||
s.rootStore.metrics.IncrementMemCacheInvalidationCounter("Webhook - Purge")
|
||||
s.rootStore.metrics.IncrementMemCacheInvalidationCounter(s.rootStore.webhookCache.Name())
|
||||
}
|
||||
}
|
||||
|
||||
func (s LocalCacheWebhookStore) InvalidateWebhookCache(webhookId string) {
|
||||
s.rootStore.doInvalidateCacheCluster(s.rootStore.webhookCache, webhookId, nil)
|
||||
if s.rootStore.metrics != nil {
|
||||
s.rootStore.metrics.IncrementMemCacheInvalidationCounter("Webhook - Remove by WebhookId")
|
||||
s.rootStore.metrics.IncrementMemCacheInvalidationCounter(s.rootStore.webhookCache.Name())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user