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

Signed-off-by: Zheng Wang <wangzheng@apache.org>
(cherry picked from commit 7d70141b90)
This commit is contained in:
xijiawen 2021-01-08 18:58:30 +08:00 committed by Zheng Wang
parent a573e49d69
commit 4705b4752b
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

@ -149,6 +149,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);
@ -159,17 +161,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