Janus Chow created HDDS-17935:
---------------------------------

             Summary: Add queue time and skipped/cancelled request metrics for 
datanode gRPC requests
                 Key: HDDS-17935
                 URL: https://issues.apache.org/jira/browse/HDDS-17935
             Project: Apache Ozone
          Issue Type: Improvement
            Reporter: Janus Chow
            Assignee: Janus Chow


HDDS-17168 added gauges for the datanode gRPC read executor (active threads, 
queue length), but several things are still not visible:

* How long a request waits in the read executor queue before a thread picks it 
up. Queue length alone does not show whether a slow read is spent waiting in 
the queue or in the handler.
* How many queued requests are skipped by HDDS-17877 because the client 
deadline already expired.
* How many requests end because the client cancelled the call or the connection 
closed, as opposed to failing on the datanode.

The domain socket path already reports localInQueueLatencyNs<op> (Receiver). 
GrpcMetrics has GrpcQueueTime, but only for the OM gRPC server. 
ContainerMetrics latencyNs<op> covers only the handler time.

Proposal, all in XceiverServerGrpcMetrics:
* ReadExecutorQueueTimeNs: wrap the executor passed to 
NettyServerBuilder.executor() in XceiverServerGrpc, so each task records the 
time from execute() to the start of run(). Report it as a rate plus 60s/300s 
quantiles.
* ExpiredRequestsSkipped: a counter, incremented where GrpcXceiverService skips 
a queued request whose deadline has expired (HDDS-17877).
* ClientCancelledRequests: a counter, incremented when a call is cancelled by 
the client or the transport closes before the response completes (onCancel / 
onError with CANCELLED).

Together with ContainerMetrics latencyNs<op>, this splits datanode read latency 
into queue wait and handler time, and shows how much work is wasted on requests 
the client has already given up on.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to