Andrew Wong has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/15315 )

Change subject: [java] subprocess: add a metrics message
......................................................................

[java] subprocess: add a metrics message

This patch adds a metrics message to each SubprocessResponsePB. These
metrics are general metrics that most Subprocess implementations will
likely find useful. Namely, inbound queue time, outbound queue time,
inbound queue length, outbound queue length, and execution time.

To get these metrics, I've passed the new SubprocessMetrics class around
alongside the request/response as it journeys through the
SubprocessExecutor, timing the different stages as it goes. Right before
sending the final response over the pipe, the queue lengths are
determined and the final response is built.

A couple of tests are added to demonstrate how these metrics may be
useful. Along the way, I refactored the EchoSubprocess tests to be a bit
more ergonomic w.r.t creating, sending, and receiving messages.

Along the way, I renamed some of the subprocess methods for clarity:
- ProtocolHandler.handleRequest() -> unpackAndExecuteRequest()
- ProtocolHandler.createResponse() -> executeRequest()
- MessageParser.getResponse() -> parseAndExecuteRequest()

These metrics are currently unused -- a later patch will plumb them into
the C++ metrics.

Change-Id: I11a89fff8df23c5057c577f2aebfd40922d01e3c
Reviewed-on: http://gerrit.cloudera.org:8080/15315
Reviewed-by: Adar Dembo <[email protected]>
Tested-by: Andrew Wong <[email protected]>
---
M 
java/kudu-subprocess-echo/src/main/java/org/apache/kudu/subprocess/echo/EchoProtocolHandler.java
M 
java/kudu-subprocess-echo/src/test/java/org/apache/kudu/subprocess/echo/TestEchoSubprocess.java
A 
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/InboundRequest.java
M 
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/MessageParser.java
M 
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/MessageReader.java
M 
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/MessageWriter.java
A 
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/OutboundResponse.java
M 
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/ProtocolHandler.java
M 
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/SubprocessExecutor.java
A 
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/SubprocessMetrics.java
M 
java/kudu-subprocess/src/test/java/org/apache/kudu/subprocess/MessageTestUtil.java
M src/kudu/subprocess/subprocess.proto
12 files changed, 593 insertions(+), 162 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Andrew Wong: Verified

--
To view, visit http://gerrit.cloudera.org:8080/15315
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I11a89fff8df23c5057c577f2aebfd40922d01e3c
Gerrit-Change-Number: 15315
Gerrit-PatchSet: 4
Gerrit-Owner: Andrew Wong <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Attila Bukor <[email protected]>
Gerrit-Reviewer: Hao Hao <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)

Reply via email to