jacek-lewandowski commented on code in PR #2534:
URL: https://github.com/apache/cassandra/pull/2534#discussion_r1314823447
##########
src/java/org/apache/cassandra/service/accord/AccordStateCache.java:
##########
@@ -66,22 +60,27 @@ static class Stats
private int unreferenced = 0;
private long maxSizeInBytes;
private long bytesCached = 0;
- private final Stats stats = new Stats();
+ private final String metricsScope;
+
+ @VisibleForTesting
+ final AccordStateCacheMetrics metrics;
- public AccordStateCache(ExecutorPlus loadExecutor, ExecutorPlus
saveExecutor, long maxSizeInBytes)
+ public AccordStateCache(ExecutorPlus loadExecutor, ExecutorPlus
saveExecutor, long maxSizeInBytes, String metricsScope)
{
this.loadExecutor = loadExecutor;
this.saveExecutor = saveExecutor;
this.maxSizeInBytes = maxSizeInBytes;
+ this.metricsScope = metricsScope;
+ this.metrics = new AccordStateCacheMetrics(String.format("%s-global",
metricsScope), this);
Review Comment:
hmm... it can be difficult because the `CacheMetrics` requires a reference
to the `CacheSize` instance, a cache provider implemented by the cache itself.
Although it seems justified to have a single metric for hits / misses /
requests, regardless the number of cache instances, it does not apply to the
cache size gauges, which we would have to sum up manually. If I understand that
code correctly, we create only one cache instance per class per node
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]