Skip to content

Commit 669bed5

Browse files
authored
HBASE-26702 Make ageOfLastShip, ageOfLastApplied extend TimeHistogram instead of plain histogram. (#4099)
Signed-off-by: Duo Zhang <[email protected]>
1 parent bd8a332 commit 669bed5

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationGlobalSourceSource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public class MetricsReplicationGlobalSourceSource implements MetricsReplicationS
5252
public MetricsReplicationGlobalSourceSource(MetricsReplicationSourceImpl rms) {
5353
this.rms = rms;
5454

55-
ageOfLastShippedOpHist = rms.getMetricsRegistry().getHistogram(SOURCE_AGE_OF_LAST_SHIPPED_OP);
55+
ageOfLastShippedOpHist =
56+
rms.getMetricsRegistry().newTimeHistogram(SOURCE_AGE_OF_LAST_SHIPPED_OP);
5657

5758
sizeOfLogQueueGauge = rms.getMetricsRegistry().getGauge(SOURCE_SIZE_OF_LOG_QUEUE, 0L);
5859

hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSinkSourceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class MetricsReplicationSinkSourceImpl implements MetricsReplicationSinkS
3030
private final MutableFastCounter hfilesCounter;
3131

3232
public MetricsReplicationSinkSourceImpl(MetricsReplicationSourceImpl rms) {
33-
ageHist = rms.getMetricsRegistry().getHistogram(SINK_AGE_OF_LAST_APPLIED_OP);
33+
ageHist = rms.getMetricsRegistry().newTimeHistogram(SINK_AGE_OF_LAST_APPLIED_OP);
3434
batchesCounter = rms.getMetricsRegistry().getCounter(SINK_APPLIED_BATCHES, 0L);
3535
opsCounter = rms.getMetricsRegistry().getCounter(SINK_APPLIED_OPS, 0L);
3636
hfilesCounter = rms.getMetricsRegistry().getCounter(SINK_APPLIED_HFILES, 0L);

hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationSourceSourceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public MetricsReplicationSourceSourceImpl(MetricsReplicationSourceImpl rms, Stri
7979
this.keyPrefix = "source." + this.id + ".";
8080

8181
ageOfLastShippedOpKey = this.keyPrefix + "ageOfLastShippedOp";
82-
ageOfLastShippedOpHist = rms.getMetricsRegistry().getHistogram(ageOfLastShippedOpKey);
82+
ageOfLastShippedOpHist = rms.getMetricsRegistry().newTimeHistogram(ageOfLastShippedOpKey);
8383

8484
sizeOfLogQueueKey = this.keyPrefix + "sizeOfLogQueue";
8585
sizeOfLogQueueGauge = rms.getMetricsRegistry().getGauge(sizeOfLogQueueKey, 0L);

hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/replication/regionserver/MetricsReplicationTableSourceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public MetricsReplicationTableSourceImpl(MetricsReplicationSourceImpl rms, Strin
4444
this.keyPrefix = "source." + this.tableName + ".";
4545

4646
ageOfLastShippedOpKey = this.keyPrefix + "ageOfLastShippedOp";
47-
ageOfLastShippedOpHist = rms.getMetricsRegistry().getHistogram(ageOfLastShippedOpKey);
47+
ageOfLastShippedOpHist = rms.getMetricsRegistry().newTimeHistogram(ageOfLastShippedOpKey);
4848

4949
shippedBytesKey = this.keyPrefix + "shippedBytes";
5050
shippedBytesCounter = rms.getMetricsRegistry().getCounter(shippedBytesKey, 0L);

0 commit comments

Comments
 (0)