|
@@ -171,6 +171,7 @@ public class FinalRequestProcessor implements RequestProcessor {
|
|
|
Code err = Code.OK;
|
|
|
Record rsp = null;
|
|
|
String path = null;
|
|
|
+ int responseSize = 0;
|
|
|
try {
|
|
|
if (request.getHdr() != null && request.getHdr().getType() == OpCode.error) {
|
|
|
AuditHelper.addAuditLog(request, rc, true);
|
|
@@ -213,7 +214,7 @@ public class FinalRequestProcessor implements RequestProcessor {
|
|
|
lastOp = "PING";
|
|
|
updateStats(request, lastOp, lastZxid);
|
|
|
|
|
|
- cnxn.sendResponse(new ReplyHeader(ClientCnxn.PING_XID, lastZxid, 0), null, "response");
|
|
|
+ responseSize = cnxn.sendResponse(new ReplyHeader(ClientCnxn.PING_XID, lastZxid, 0), null, "response");
|
|
|
return;
|
|
|
}
|
|
|
case OpCode.createSession: {
|
|
@@ -599,7 +600,7 @@ public class FinalRequestProcessor implements RequestProcessor {
|
|
|
|
|
|
try {
|
|
|
if (path == null || rsp == null) {
|
|
|
- cnxn.sendResponse(hdr, rsp, "response");
|
|
|
+ responseSize = cnxn.sendResponse(hdr, rsp, "response");
|
|
|
} else {
|
|
|
int opCode = request.type;
|
|
|
Stat stat = null;
|
|
@@ -610,17 +611,17 @@ public class FinalRequestProcessor implements RequestProcessor {
|
|
|
case OpCode.getData : {
|
|
|
GetDataResponse getDataResponse = (GetDataResponse) rsp;
|
|
|
stat = getDataResponse.getStat();
|
|
|
- cnxn.sendResponse(hdr, rsp, "response", path, stat, opCode);
|
|
|
+ responseSize = cnxn.sendResponse(hdr, rsp, "response", path, stat, opCode);
|
|
|
break;
|
|
|
}
|
|
|
case OpCode.getChildren2 : {
|
|
|
GetChildren2Response getChildren2Response = (GetChildren2Response) rsp;
|
|
|
stat = getChildren2Response.getStat();
|
|
|
- cnxn.sendResponse(hdr, rsp, "response", path, stat, opCode);
|
|
|
+ responseSize = cnxn.sendResponse(hdr, rsp, "response", path, stat, opCode);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
- cnxn.sendResponse(hdr, rsp, "response");
|
|
|
+ responseSize = cnxn.sendResponse(hdr, rsp, "response");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -629,6 +630,8 @@ public class FinalRequestProcessor implements RequestProcessor {
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
LOG.error("FIXMSG", e);
|
|
|
+ } finally {
|
|
|
+ ServerMetrics.getMetrics().RESPONSE_BYTES.add(responseSize);
|
|
|
}
|
|
|
}
|
|
|
|