HDFS-16998. RBF: Add ops metrics for getSlowDatanodeReport in RouterClientActivity (#5615)
This commit is contained in:
parent
27776ac45e
commit
ceb8878d4f
@ -147,6 +147,7 @@ public class RouterClientMetrics {
|
||||
@Metric private MutableCounterLong satisfyStoragePolicyOps;
|
||||
@Metric private MutableCounterLong getHAServiceStateOps;
|
||||
@Metric private MutableCounterLong otherOps;
|
||||
@Metric private MutableCounterLong getSlowDatanodeReportOps;
|
||||
|
||||
// private ConcurrentOps
|
||||
@Metric private MutableCounterLong concurrentSetReplicationOps;
|
||||
@ -184,6 +185,7 @@ public class RouterClientMetrics {
|
||||
@Metric private MutableCounterLong concurrentSetQuotaOps;
|
||||
@Metric private MutableCounterLong concurrentGetQuotaUsageOps;
|
||||
@Metric private MutableCounterLong concurrentOtherOps;
|
||||
@Metric private MutableCounterLong concurrentGetSlowDatanodeReportOps;
|
||||
|
||||
RouterClientMetrics(String processName, String sessionId) {
|
||||
registry.tag(ProcessName, processName).tag(SessionId, sessionId);
|
||||
@ -525,6 +527,9 @@ public void incInvokedMethod(Method method) {
|
||||
case "getHAServiceState":
|
||||
getHAServiceStateOps.incr();
|
||||
break;
|
||||
case "getSlowDatanodeReport":
|
||||
getSlowDatanodeReportOps.incr();
|
||||
break;
|
||||
default:
|
||||
otherOps.incr();
|
||||
}
|
||||
@ -638,6 +643,9 @@ public void incInvokedConcurrent(Method method){
|
||||
case "getQuotaUsage":
|
||||
concurrentGetQuotaUsageOps.incr();
|
||||
break;
|
||||
case "getSlowDatanodeReport":
|
||||
concurrentGetSlowDatanodeReportOps.incr();
|
||||
break;
|
||||
default :
|
||||
concurrentOtherOps.incr();
|
||||
}
|
||||
|
@ -170,5 +170,12 @@ public void testGetDatanodeReport() throws Exception {
|
||||
getMetrics(ROUTER_METRICS));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSlowDatanodeReport() throws Exception {
|
||||
router.getRpcServer().getSlowDatanodeReport();
|
||||
assertCounter("GetSlowDatanodeReportOps", 2L, getMetrics(ROUTER_METRICS));
|
||||
assertCounter("ConcurrentGetSlowDatanodeReportOps", 1L, getMetrics(ROUTER_METRICS));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user