Skip to content

Commit

Permalink
HBASE-27892 Report memstore on-heap and off-heap size as jmx metrics (#…
Browse files Browse the repository at this point in the history
…5308)

Signed-off-by: Viraj Jasani <vjasani@apache.org>
  • Loading branch information
jinggou committed Jun 27, 2023
1 parent 66fd6db commit 0637bbc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ public interface MetricsRegionServerSource extends BaseSource, JvmPauseMonitorSo
String MAX_COMPACTED_STORE_FILE_REF_COUNT = "maxCompactedStoreFileRefCount";
String MEMSTORE_SIZE = "memStoreSize";
String MEMSTORE_SIZE_DESC = "Size of the memstore";
String MEMSTORE_HEAP_SIZE = "memStoreHeapSize";
String MEMSTORE_HEAP_SIZE_DESC = "On-heap Size of the memstore";
String MEMSTORE_OFFHEAP_SIZE = "memStoreOffHeapSize";
String MEMSTORE_OFFHEAP_SIZE_DESC = "Off-heap Size of the memstore";
String STOREFILE_SIZE = "storeFileSize";
String STOREFILE_SIZE_GROWTH_RATE = "storeFileSizeGrowthRate";
String MAX_STORE_FILE_AGE = "maxStoreFileAge";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,10 @@ private MetricsRecordBuilder addGaugesToMetricsRecordBuilder(MetricsRecordBuilde
.addGauge(Interns.info(MAX_STOREFILE_COUNT, MAX_STOREFILE_COUNT_DESC),
rsWrap.getMaxStoreFiles())
.addGauge(Interns.info(MEMSTORE_SIZE, MEMSTORE_SIZE_DESC), rsWrap.getMemStoreSize())
.addGauge(Interns.info(MEMSTORE_HEAP_SIZE, MEMSTORE_HEAP_SIZE_DESC),
rsWrap.getOnHeapMemStoreSize())
.addGauge(Interns.info(MEMSTORE_OFFHEAP_SIZE, MEMSTORE_OFFHEAP_SIZE_DESC),
rsWrap.getOffHeapMemStoreSize())
.addGauge(Interns.info(STOREFILE_SIZE, STOREFILE_SIZE_DESC), rsWrap.getStoreFileSize())
.addGauge(Interns.info(STOREFILE_SIZE_GROWTH_RATE, STOREFILE_SIZE_GROWTH_RATE_DESC),
rsWrap.getStoreFileSizeGrowthRate())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public void testWrapperSource() {
HELPER.assertGauge("hlogFileSize", 1024000, serverSource);
HELPER.assertGauge("storeFileCount", 300, serverSource);
HELPER.assertGauge("memstoreSize", 1025, serverSource);
HELPER.assertGauge("memstoreHeapSize", 500, serverSource);
HELPER.assertGauge("memstoreOffHeapSize", 600, serverSource);
HELPER.assertGauge("storeFileSize", 1900, serverSource);
HELPER.assertGauge("storeFileSizeGrowthRate", 50.0, serverSource);
HELPER.assertCounter("totalRequestCount", 899, serverSource);
Expand Down

0 comments on commit 0637bbc

Please sign in to comment.