This code is responsible for the metric BlockCacheExpressHitPercent. The metric represents the percentage of requests which were cacheable, but not found in the cache. Unfortunately, since the counters are process-level counters, the ratio is for the lifetime of the process. This makes it less useful for looking at cache behavior during a smaller time period.
The underlying counters are hitCachingCount and missCachingCount. Having access to the underlying counters allows for offline computation of the same metric for any given time period. But these counters are not emitted today from MetricsRegionServerWrapperImpl.java.
Compare this to hitCount and missCount which are emitted as metrics blockCacheHitCount and blockCacheMissCount. But these are raw counts for the cache, which include requests that are not cacheable. The cacheable metrics are more interesting, since it can be common to miss on a request which is not cacheable.
Interestingly, these metrics are emitted regularly as part of a log line in StatisticsThread.logStats.
We should emit blockCacheHitCachingCount and blockCacheMissCachingCount along with the current metrics.