Negative cache miss metric
See original GitHub issueHi,
I’m registering sme Hazelcast cache metrics using
HazelcastCacheMetrics.monitor(meterRegistry, hazelcastInstance.getMap(Constants.METADATA_DEFINITION_CACHE));
And then using then like this:
@CachePut(value = Constants.METADATA_DEFINITION_CACHE, key = "#metadataDefinitionId", unless = "#result == null")
public MetadataDefinition putMetadataDefinition(long metadataDefinitionId) {
return getMetadataDefinitionMetadataInternal(metadataDefinitionId);
}
@Cacheable(value = Constants.METADATA_DEFINITION_CACHE, key = "#metadataDefinitionId", unless = "#result == null")
public MetadataDefinition getMetadataDefinition(long metadataDefinitionId) {
return getMetadataDefinitionMetadataInternal(metadataDefinitionId);
}
@CacheEvict(value = Constants.METADATA_DEFINITION_CACHE, key = "#metadataDefinitionId")
public void removeFromCache(long metadataDefinitionId) {
}
but somehow I’m getting negative miss values.
# HELP cache_gets_total the number of times cache lookup methods have returned an uncached (newly loaded) value, or null
# TYPE cache_gets_total counter
cache_gets_total{cache="metadataDefinitionCache",result="miss",} -156909.0
cache_gets_total{cache="metadataDefinitionCache",result="hit",} 314086.0
Any ideas why?
Thanks
Nick
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Review and monitoring - Streaming Media Lens
A Cache Hit Ratio (CHR) is the ratio of requests served from cache (matches) to the total requests (misses and matches) over a...
Read more >Cache performance measurement and metric - Wikipedia
Another useful metric to test the performance is Power law of cache misses. It gives you the number of misses when you change...
Read more >Metrics and Statistics — PowerDNS Recursor documentation
There are 1773 items in the negative cache, items of which it is known that don't exist and won't do so for the...
Read more >Linux perf reporting cache misses for unexpected instruction
For your Nehalem (Intel Core i5 750 with L3 cache of 8MB and without ... and reset PMU counter back to some negative...
Read more >What is a Cache Hit Ratio and How do you Calculate it?
Answer this question by using cache hit and miss ratios that can help you determine whether your cache is working successfully. These metrics...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just as a hint, when somebody touches the file, the class Javadoc mentions “EhCache”. Likely a C&P leftover.
@nickcodefresh Without your screenshots, this would have been very hard to track down. In the end, I concluded that it is impossible to calculate miss count against Hazelcast caches 😦
I’ve removed the metric from the Hazelcast implementation, and added another FunctionCounter,
cache.partition.gets
.See this for the detail on why miss count is incalculable on Hazelcast.
If it is really important for you to know miss count, you can create a wrapper
IMap
type that adds to a counter every timeget
is about to return null.