ramkrish86 commented on a change in pull request #1552: URL: https://github.com/apache/hbase/pull/1552#discussion_r430396089
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java ########## @@ -2884,4 +2901,41 @@ public int getMaxCompactedStoreFileRefCount() { ? maxCompactedStoreFileRefCount.getAsInt() : 0; } + @Override + public long getReadRequestsFromStoreCount() { + return getRequestsFromStore.sum(); + } + + @Override + public long getGetRequestsCountFromMemstore() { + return getRequestsFromMemstore.sum(); + } + + @Override + public long getGetRequestsCountFromFile() { + return getRequestsFromFile.sum(); + } + + void incrGetRequestsFromStore() { + getRequestsFromStore.increment(); Review comment: The one direclty inder HStore is used by the Region level and Table level aggregators which deals with HStore. This gets printed periodically. The other one is at the MetricsStore level which is the real time one. For every request it will be displayed at JMX MBean level. ########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsTableWrapperAggregateImpl.java ########## @@ -70,25 +69,36 @@ public void run() { localMetricsTableMap.put(tbl, mt); } if (r.getStores() != null) { + long memstoreReadCount = 0l; + long fileReadCount = 0l; + String familyName = null; for (Store store : r.getStores()) { + familyName = store.getColumnFamilyName(); + mt.storeFileCount += store.getStorefilesCount(); - mt.memstoreSize += (store.getMemStoreSize().getDataSize() + - store.getMemStoreSize().getHeapSize() + store.getMemStoreSize().getOffHeapSize()); + mt.memstoreSize += (store.getMemStoreSize().getDataSize() + + store.getMemStoreSize().getHeapSize() + store.getMemStoreSize().getOffHeapSize()); mt.storeFileSize += store.getStorefilesSize(); mt.referenceFileCount += store.getNumReferenceFiles(); - mt.maxStoreFileAge = Math.max(mt.maxStoreFileAge, store.getMaxStoreFileAge().getAsLong()); - mt.minStoreFileAge = Math.min(mt.minStoreFileAge, store.getMinStoreFileAge().getAsLong()); - mt.totalStoreFileAge = (long)store.getAvgStoreFileAge().getAsDouble() * - store.getStorefilesCount(); + mt.maxStoreFileAge = + Math.max(mt.maxStoreFileAge, store.getMaxStoreFileAge().getAsLong()); + mt.minStoreFileAge = + Math.min(mt.minStoreFileAge, store.getMinStoreFileAge().getAsLong()); + mt.totalStoreFileAge = + (long) store.getAvgStoreFileAge().getAsDouble() * store.getStorefilesCount(); mt.storeCount += 1; + memstoreReadCount += store.getGetRequestsCountFromMemstore(); + fileReadCount += store.getGetRequestsCountFromFile(); + mt.storeMemstoreGetCount.putIfAbsent(familyName, memstoreReadCount); + mt.storeFileGetCount.putIfAbsent(familyName, fileReadCount); } + mt.regionCount += 1; mt.readRequestCount += r.getReadRequestsCount(); - mt.filteredReadRequestCount += getFilteredReadRequestCount(tbl.getNameAsString()); + mt.filteredReadRequestCount += r.getFilteredReadRequestsCount(); Review comment: This was wrong. It is a simple change. So I thought it is better to make this change hhere. If you are particular i can make the change in separete JIRA. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org