Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,11 @@ public interface MetricsRegionServerSource extends BaseSource, JvmPauseMonitorSo
*/
void incrSlowAppend();

/**
* Update the split transaction time histogram
* @param t time it took, in milliseconds
*/
void updateSplitTime(long t);

/**
* Increment number of a requested splits
*/
void incrSplitRequest();

/**
* Increment number of successful splits
*/
void incrSplitSuccess();

/**
* Update the flush time histogram
* @param t time it took, in milliseconds
Expand Down Expand Up @@ -564,11 +553,8 @@ public interface MetricsRegionServerSource extends BaseSource, JvmPauseMonitorSo
String BLOCKED_REQUESTS_COUNT_DESC = "The number of blocked requests because of memstore size is "
+ "larger than blockingMemStoreSize";

String SPLIT_KEY = "splitTime";
String SPLIT_REQUEST_KEY = "splitRequestCount";
String SPLIT_REQUEST_DESC = "Number of splits requested";
String SPLIT_SUCCESS_KEY = "splitSuccessCount";
String SPLIT_SUCCESS_DESC = "Number of successfully executed splits";

String FLUSH_TIME = "flushTime";
String FLUSH_TIME_DESC = "Histogram for the time in millis for memstore flush";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ public class MetricsRegionServerSourceImpl extends BaseSourceImpl

// split related metrics
private final MutableFastCounter splitRequest;
private final MutableFastCounter splitSuccess;
private final MetricHistogram splitTimeHisto;

// flush related metrics
private final MetricHistogram flushTimeHisto;
Expand Down Expand Up @@ -182,9 +180,7 @@ public MetricsRegionServerSourceImpl(String metricsName, String metricsDescripti
majorCompactedOutputBytes = getMetricsRegistry().newCounter(MAJOR_COMPACTED_OUTPUT_BYTES,
MAJOR_COMPACTED_OUTPUT_BYTES_DESC, 0L);

splitTimeHisto = getMetricsRegistry().newTimeHistogram(SPLIT_KEY);
splitRequest = getMetricsRegistry().newCounter(SPLIT_REQUEST_KEY, SPLIT_REQUEST_DESC, 0L);
splitSuccess = getMetricsRegistry().newCounter(SPLIT_SUCCESS_KEY, SPLIT_SUCCESS_DESC, 0L);

// pause monitor metrics
infoPauseThresholdExceeded =
Expand Down Expand Up @@ -280,16 +276,6 @@ public void incrSplitRequest() {
splitRequest.incr();
}

@Override
public void incrSplitSuccess() {
splitSuccess.incr();
}

@Override
public void updateSplitTime(long t) {
splitTimeHisto.add(t);
}

@Override
public void updateFlushTime(long t) {
flushTimeHisto.add(t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,11 @@ public interface MetricsTableSource extends Comparable<MetricsTableSource>, Clos
*/
MetricsTableAggregateSource getAggregateSource();

/**
* Update the split transaction time histogram
* @param t time it took, in milliseconds
*/
void updateSplitTime(long t);

/**
* Increment number of a requested splits
*/
void incrSplitRequest();

/**
* Increment number of successful splits
*/
void incrSplitSuccess();

/**
* Update the flush time histogram
* @param t time it took, in milliseconds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,8 @@
import static org.apache.hadoop.hbase.regionserver.MetricsRegionServerSource.MAJOR_COMPACTION_OUTPUT_SIZE_DESC;
import static org.apache.hadoop.hbase.regionserver.MetricsRegionServerSource.MAJOR_COMPACTION_TIME;
import static org.apache.hadoop.hbase.regionserver.MetricsRegionServerSource.MAJOR_COMPACTION_TIME_DESC;
import static org.apache.hadoop.hbase.regionserver.MetricsRegionServerSource.SPLIT_KEY;
import static org.apache.hadoop.hbase.regionserver.MetricsRegionServerSource.SPLIT_REQUEST_DESC;
import static org.apache.hadoop.hbase.regionserver.MetricsRegionServerSource.SPLIT_REQUEST_KEY;
import static org.apache.hadoop.hbase.regionserver.MetricsRegionServerSource.SPLIT_SUCCESS_DESC;
import static org.apache.hadoop.hbase.regionserver.MetricsRegionServerSource.SPLIT_SUCCESS_KEY;

import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -101,8 +98,6 @@ public class MetricsTableSourceImpl implements MetricsTableSource {

// split related metrics
private MutableFastCounter splitRequest;
private MutableFastCounter splitSuccess;
private MetricHistogram splitTimeHisto;

// flush related metrics
private MetricHistogram flushTimeHisto;
Expand Down Expand Up @@ -186,9 +181,7 @@ public synchronized void registerMetrics() {
majorCompactedOutputBytes = registry.newCounter(tableNamePrefix + MAJOR_COMPACTED_OUTPUT_BYTES,
MAJOR_COMPACTED_OUTPUT_BYTES_DESC, 0L);

splitTimeHisto = registry.newTimeHistogram(tableNamePrefix + SPLIT_KEY);
splitRequest = registry.newCounter(tableNamePrefix + SPLIT_REQUEST_KEY, SPLIT_REQUEST_DESC, 0L);
splitSuccess = registry.newCounter(tableNamePrefix + SPLIT_SUCCESS_KEY, SPLIT_SUCCESS_DESC, 0L);
}

private void deregisterMetrics() {
Expand All @@ -211,9 +204,7 @@ private void deregisterMetrics() {
registry.removeHistogramMetrics(tableNamePrefix + MAJOR_COMPACTION_OUTPUT_SIZE);
registry.removeMetric(tableNamePrefix + MAJOR_COMPACTED_INPUT_BYTES);
registry.removeMetric(tableNamePrefix + MAJOR_COMPACTED_OUTPUT_BYTES);
registry.removeHistogramMetrics(tableNamePrefix + SPLIT_KEY);
registry.removeMetric(tableNamePrefix + SPLIT_REQUEST_KEY);
registry.removeMetric(tableNamePrefix + SPLIT_SUCCESS_KEY);
}

@Override
Expand Down Expand Up @@ -428,16 +419,6 @@ public void incrSplitRequest() {
splitRequest.incr();
}

@Override
public void incrSplitSuccess() {
splitSuccess.incr();
}

@Override
public void updateSplitTime(long t) {
splitTimeHisto.add(t);
}

@Override
public void updateFlushTime(long t) {
flushTimeHisto.add(t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,11 @@ public void updateScan(HRegion region, long time, long responseCellSize, long bl
userAggregate.updateScan(time, blockBytesScanned);
}

public void updateSplitTime(long t) {
serverSource.updateSplitTime(t);
}

public void incrSplitRequest() {
public void incrSplitRequest(String table) {
serverSource.incrSplitRequest();
}

public void incrSplitSuccess() {
serverSource.incrSplitSuccess();
if (table != null) {
metricsTable.incrSplitRequest(table);
}
}
Comment on lines -219 to 217
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addition


public void updateFlush(String table, long t, long memstoreSize, long fileSize) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ public void incrSplitRequest(String table) {
tableSourceAgg.getOrCreateTableSource(table, wrapper).incrSplitRequest();
}

public void incrSplitSuccess(String table) {
tableSourceAgg.getOrCreateTableSource(table, wrapper).incrSplitSuccess();
}

public void updateSplitTime(String table, long t) {
tableSourceAgg.getOrCreateTableSource(table, wrapper).updateSplitTime(t);
}

public void updateFlushTime(String table, long t) {
tableSourceAgg.getOrCreateTableSource(table, wrapper).updateFlushTime(t);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public String toString() {
}

private void doSplitting() {
server.getMetrics().incrSplitRequest();
server.getMetrics().incrSplitRequest(this.parent.getTable().getNameAsString());
if (user != null && user.getUGI() != null) {
user.getUGI().doAs((PrivilegedAction<Void>) () -> {
requestRegionSplit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,10 @@ public void testThrottleExceptionMetricsIntegration() {
"RpcThrottlingException_Type_ReadCapacityUnitExceeded_User_unknown_Table_unknown", 1L,
serverSource);
}

@Test
public void testSplitRequest() {
rsm.incrSplitRequest(null);
HELPER.assertCounter("splitRequestCount", 1, serverSource);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ public void testCompaction() {
HELPER.assertCounter(pre + "majorCompactedoutputBytes", 500, agg);
}

@Test
public void testSplitRequest() {
rsm.incrSplitRequest(null);
rsm.incrSplitRequest(tableName);
HELPER.assertCounter(pre + "splitRequestCount", 1, agg);
}

private void update(AtomicBoolean succ, int round, CyclicBarrier barrier) {
try {
for (int i = 0; i < round; i++) {
Expand Down
Loading