Skip to content
Draft
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 @@ -38,6 +38,7 @@ public interface MetricsRegionSource extends Comparable<MetricsRegionSource> {
String NUM_FILES_COMPACTED_COUNT = "numFilesCompactedCount";
String FLUSHES_QUEUED_COUNT = "flushesQueuedCount";
String MAX_FLUSH_QUEUE_SIZE = "maxFlushQueueSize";
String ROW_SEQUENCING_YIELDS = "rowSequencingYields";
String COMPACTIONS_COMPLETED_DESC = "Number of compactions that have completed.";
String COMPACTIONS_FAILED_DESC = "Number of compactions that have failed.";
String LAST_MAJOR_COMPACTION_DESC = "Age of the last major compaction in milliseconds.";
Expand All @@ -57,6 +58,7 @@ public interface MetricsRegionSource extends Comparable<MetricsRegionSource> {
String ROW_READS_ONLY_ON_MEMSTORE_DESC = "Row reads happening completely out of memstore";
String MIXED_ROW_READS = "mixedRowReadsCount";
String MIXED_ROW_READS_ON_STORE_DESC = "Row reads happening out of files and memstore on store";
String ROW_SEQUENCING_YIELDS_DESC = "Number of yields taken to sequence row commits";

/**
* Close the region's metrics as this region is closing.
Expand Down Expand Up @@ -99,5 +101,9 @@ public interface MetricsRegionSource extends Comparable<MetricsRegionSource> {
*/
MetricsRegionAggregateSource getAggregateSource();

/**
* Update count of row sequencing yields.
*/
void updateRowSequencingYields();

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class MetricsRegionSourceImpl implements MetricsRegionSource {
private final String regionIncrementKey;
private final String regionAppendKey;
private final String regionScanKey;

private final String regionRowSequencerYieldsKey;
/*
* Implementation note: Do not put histograms per region. With hundreds of regions in a server
* histograms allocate too many counters. See HBASE-17016.
Expand All @@ -69,6 +69,8 @@ public class MetricsRegionSourceImpl implements MetricsRegionSource {
private final MutableFastCounter regionGet;
private final MutableFastCounter regionScan;

private final MutableFastCounter regionRowSequencerYields;

private final int hashCode;

public MetricsRegionSourceImpl(MetricsRegionWrapper regionWrapper,
Expand Down Expand Up @@ -107,6 +109,10 @@ public MetricsRegionSourceImpl(MetricsRegionWrapper regionWrapper,

regionScanKey = regionNamePrefix + MetricsRegionServerSource.SCAN_KEY + suffix;
regionScan = registry.getCounter(regionScanKey, 0L);

regionRowSequencerYieldsKey = regionNamePrefix + MetricsRegionSource.ROW_SEQUENCING_YIELDS +
suffix;
regionRowSequencerYields = registry.getCounter(regionRowSequencerYieldsKey, 0L);
}

@Override
Expand Down Expand Up @@ -135,6 +141,7 @@ public void close() {
registry.removeMetric(regionAppendKey);
registry.removeMetric(regionGetKey);
registry.removeMetric(regionScanKey);
registry.removeMetric(regionRowSequencerYieldsKey);

regionWrapper = null;
}
Expand Down Expand Up @@ -170,6 +177,11 @@ public void updateAppend() {
regionAppend.incr();
}

@Override
public void updateRowSequencingYields() {
regionRowSequencerYields.incr();
}

@Override
public MetricsRegionAggregateSource getAggregateSource() {
return agg;
Expand Down Expand Up @@ -302,6 +314,10 @@ void snapshot(MetricsRecordBuilder mrb, boolean ignored) {
regionNamePrefix + MetricsRegionSource.MAX_FLUSH_QUEUE_SIZE,
MetricsRegionSource.MAX_FLUSH_QUEUE_DESC),
this.regionWrapper.getMaxFlushQueueSize());
mrb.addCounter(Interns.info(
regionNamePrefix + MetricsRegionSource.ROW_SEQUENCING_YIELDS,
MetricsRegionSource.ROW_SEQUENCING_YIELDS_DESC),
this.regionWrapper.getRowSequencingYields());
addCounter(mrb, this.regionWrapper.getMemstoreOnlyRowReadsCount(),
MetricsRegionSource.ROW_READS_ONLY_ON_MEMSTORE,
MetricsRegionSource.ROW_READS_ONLY_ON_MEMSTORE_DESC);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,8 @@ public interface MetricsRegionWrapper {
*/
Map<String, Long> getMixedRowReadsCount();

/**
* @return the number of yields made for row sequencing
*/
long getRowSequencingYields();
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,5 +233,10 @@ public Map<String, Long> getMixedRowReadsCount() {
map.put("info", 0L);
return map;
}

@Override
public long getRowSequencingYields() {
return 0;
}
}
}
Loading