[
https://issues.apache.org/jira/browse/HBASE-27159?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17565205#comment-17565205
]
Andrew Kyle Purtell edited comment on HBASE-27159 at 7/12/22 12:50 AM:
-----------------------------------------------------------------------
Note recent metrics improvements proposals (with approved PRs) HBASE-27186
especially and HBASE-27188.
The proposal here also sounds good and could make 2.5.0 along with the others
if a patch becomes available this week. [~dmanning]
was (Author: apurtell):
Note recent metrics improvements proposals (with approved PRs) HBASE-27186
especially and HBASE-27188.
The proposal here also sounds good and could make 2.5.0 if a patch becomes
available this week. [~dmanning]
> Emit source metrics for BlockCacheExpressHitPercent, blockCache counts of
> hits and misses for cacheable requests
> ----------------------------------------------------------------------------------------------------------------
>
> Key: HBASE-27159
> URL: https://issues.apache.org/jira/browse/HBASE-27159
> Project: HBase
> Issue Type: Improvement
> Components: BlockCache, metrics
> Affects Versions: 3.0.0-alpha-1, 2.0.0
> Reporter: David Manning
> Priority: Minor
>
> [https://github.com/apache/hbase/blob/d447fa01ba36a11d57927b78cce1bbca361b1d52/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheStats.java#L346-L400]
> {code:java}
> public double getHitCachingRatio() {
> double requestCachingCount = getRequestCachingCount();
> if (requestCachingCount == 0) {
> return 0;
> }
> return getHitCachingCount() / requestCachingCount;
> } {code}
> 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 blockCache{{{}HitCachingCount{}}} and
> {{blockCacheMissCachingCount}} along with the current metrics.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)