HBASE-25434 SlowDelete & SlowPut metric value should use updateDelete & updatePut (#2837)

Signed-off-by: Zheng Wang <wangzheng@apache.org>
This commit is contained in:
xijiawen 2021-01-08 18:58:30 +08:00 committed by GitHub
parent 45ef88dc8d
commit 7d70141b90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 10 deletions

View File

@ -113,9 +113,6 @@ public class MetricsRegionServer {
if (tableMetrics != null && tn != null) {
tableMetrics.updatePutBatch(tn, t);
}
if (t > slowMetricTime) {
serverSource.incrSlowPut();
}
serverSource.updatePutBatch(t);
}
@ -123,6 +120,9 @@ public class MetricsRegionServer {
if (tableMetrics != null && tn != null) {
tableMetrics.updatePut(tn, t);
}
if (t > slowMetricTime) {
serverSource.incrSlowPut();
}
serverSource.updatePut(t);
userAggregate.updatePut(t);
}
@ -131,6 +131,9 @@ public class MetricsRegionServer {
if (tableMetrics != null && tn != null) {
tableMetrics.updateDelete(tn, t);
}
if (t > slowMetricTime) {
serverSource.incrSlowDelete();
}
serverSource.updateDelete(t);
userAggregate.updateDelete(t);
}
@ -139,9 +142,6 @@ public class MetricsRegionServer {
if (tableMetrics != null && tn != null) {
tableMetrics.updateDeleteBatch(tn, t);
}
if (t > slowMetricTime) {
serverSource.incrSlowDelete();
}
serverSource.updateDeleteBatch(t);
}

View File

@ -151,6 +151,8 @@ public class TestMetricsRegionServer {
for (int i=0; i < 17; i ++) {
rsm.updatePut(null, 17);
rsm.updateDelete(null, 17);
rsm.updatePut(null, 1006);
rsm.updateDelete(null, 1003);
rsm.updateCheckAndDelete(null, 17);
rsm.updateCheckAndPut(null, 17);
rsm.updateCheckAndMutate(null, 17);
@ -161,17 +163,17 @@ public class TestMetricsRegionServer {
HELPER.assertCounter("getNumOps", 28, serverSource);
HELPER.assertCounter("incrementNumOps", 30, serverSource);
HELPER.assertCounter("putBatchNumOps", 32, serverSource);
HELPER.assertCounter("putNumOps", 17, serverSource);
HELPER.assertCounter("deleteNumOps", 17, serverSource);
HELPER.assertCounter("putNumOps", 34, serverSource);
HELPER.assertCounter("deleteNumOps", 34, serverSource);
HELPER.assertCounter("checkAndDeleteNumOps", 17, serverSource);
HELPER.assertCounter("checkAndPutNumOps", 17, serverSource);
HELPER.assertCounter("checkAndMutateNumOps", 17, serverSource);
HELPER.assertCounter("slowAppendCount", 12, serverSource);
HELPER.assertCounter("slowDeleteCount", 13, serverSource);
HELPER.assertCounter("slowDeleteCount", 17, serverSource);
HELPER.assertCounter("slowGetCount", 14, serverSource);
HELPER.assertCounter("slowIncrementCount", 15, serverSource);
HELPER.assertCounter("slowPutCount", 16, serverSource);
HELPER.assertCounter("slowPutCount", 17, serverSource);
}
@Test