[ https://issues.apache.org/jira/browse/HBASE-24615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17158049#comment-17158049 ]
Viraj Jasani commented on HBASE-24615: -------------------------------------- [~zghao] are you fine with this patch landing on branch-2.2 as I see 2.2.6 RC preparation going on? > MutableRangeHistogram#updateSnapshotRangeMetrics doesn't calculate the > distribution for last bucket. > ---------------------------------------------------------------------------------------------------- > > Key: HBASE-24615 > URL: https://issues.apache.org/jira/browse/HBASE-24615 > Project: HBase > Issue Type: Bug > Components: metrics > Affects Versions: 2.3.0, master, 1.3.7, 2.2.6 > Reporter: Rushabh Shah > Assignee: wenfeiyi666 > Priority: Major > > We are not processing the distribution for last bucket. > https://github.com/apache/hbase/blob/master/hbase-hadoop-compat/src/main/java/org/apache/hadoop/metrics2/lib/MutableRangeHistogram.java#L70 > {code:java} > public void updateSnapshotRangeMetrics(MetricsRecordBuilder > metricsRecordBuilder, > Snapshot snapshot) { > long priorRange = 0; > long cumNum = 0; > final long[] ranges = getRanges(); > final String rangeType = getRangeType(); > for (int i = 0; i < ranges.length - 1; i++) { -----> The bug lies > here. We are not processing last bucket. > long val = snapshot.getCountAtOrBelow(ranges[i]); > if (val - cumNum > 0) { > metricsRecordBuilder.addCounter( > Interns.info(name + "_" + rangeType + "_" + priorRange + "-" + > ranges[i], desc), > val - cumNum); > } > priorRange = ranges[i]; > cumNum = val; > } > long val = snapshot.getCount(); > if (val - cumNum > 0) { > metricsRecordBuilder.addCounter( > Interns.info(name + "_" + rangeType + "_" + ranges[ranges.length - > 1] + "-inf", desc), > val - cumNum); > } > } > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)