HBASE-22616 responseTooXXX logging for Multi should characterize the component ops (#329)

Signed-off-by: Reid Chan <reidchan@apache.org>
Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
Andrew Purtell 2019-06-24 18:03:17 -07:00
parent 360288a320
commit a1aab9514f
No known key found for this signature in database
GPG Key ID: 8597754DD5365CCD
1 changed files with 22 additions and 0 deletions

View File

@ -517,6 +517,28 @@ public abstract class RpcServer implements RpcServerInterface,
}
}
}
if (param instanceof ClientProtos.MultiRequest) {
int numGets = 0;
int numMutations = 0;
int numServiceCalls = 0;
ClientProtos.MultiRequest multi = (ClientProtos.MultiRequest)param;
for (ClientProtos.RegionAction regionAction : multi.getRegionActionList()) {
for (ClientProtos.Action action: regionAction.getActionList()) {
if (action.hasMutation()) {
numMutations++;
}
if (action.hasGet()) {
numGets++;
}
if (action.hasServiceCall()) {
numServiceCalls++;
}
}
}
responseInfo.put("multi.gets", numGets);
responseInfo.put("multi.mutations", numMutations);
responseInfo.put("multi.servicecalls", numServiceCalls);
}
LOG.warn("(response" + tag + "): " + MAPPER.writeValueAsString(responseInfo));
}