Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.

Commit 8ea447f

Browse files
committed
fix cache purges metric
1 parent 2e5c76c commit 8ea447f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/redis_cache.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ pub struct RedisCacheStore {
8080
metric_dels_total: IntCounter,
8181
metric_expires_total: IntCounter,
8282
metric_ttls_total: IntCounter,
83-
metric_purges_total: IntCounter,
8483
metric_set_tags_total: IntCounter,
8584
}
8685

@@ -103,7 +102,6 @@ impl RedisCacheStore {
103102
metric_dels_total: CACHE_DELS_TOTAL.with_label_values(&["redis", ns_str]),
104103
metric_expires_total: CACHE_EXPIRES_TOTAL.with_label_values(&["redis", ns_str]),
105104
metric_ttls_total: CACHE_TTLS_TOTAL.with_label_values(&["redis", ns_str]),
106-
metric_purges_total: CACHE_PURGES_TOTAL.with_label_values(&["redis", ns_str]),
107105
metric_set_tags_total: CACHE_SET_TAGS_TOTAL.with_label_values(&["redis", ns_str]),
108106
}
109107
}
@@ -311,7 +309,9 @@ impl CacheStore for RedisCacheStore {
311309
}
312310

313311
fn purge_tag(&self, tag: String) -> EmptyCacheFuture {
314-
self.metric_purges_total.inc();
312+
CACHE_PURGES_TOTAL
313+
.with_label_values(&["redis", self.ns.as_str(), tag.as_str()])
314+
.inc(); // can't do that oen statically.
315315
debug!("redis cache purge_tag tag: {}", tag);
316316
let tagkey = self.tag_key(tag);
317317
let pool = self.pool.clone();

0 commit comments

Comments
 (0)