You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/05/20 22:33:15 UTC

[GitHub] [incubator-pinot] siddharthteotia commented on a change in pull request #6936: Add NETTY_CONNECTION_SEND_REQUEST_LATENCY to broker timer metrics

siddharthteotia commented on a change in pull request #6936:
URL: https://github.com/apache/incubator-pinot/pull/6936#discussion_r636519034



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/transport/ServerChannels.java
##########
@@ -144,7 +148,12 @@ synchronized void sendRequest(InstanceRequest instanceRequest)
             System.currentTimeMillis() - startTime);
       }
       byte[] requestBytes = _serializer.serialize(instanceRequest);
-      _channel.writeAndFlush(Unpooled.wrappedBuffer(requestBytes), _channel.voidPromise());
+      long sendRequestStartTimeMs = System.currentTimeMillis();
+      _channel.writeAndFlush(Unpooled.wrappedBuffer(requestBytes)).addListener(f -> {
+        _brokerMetrics.addTimedTableValue(rawTableName, BrokerTimer.NETTY_CONNECTION_SEND_REQUEST_LATENCY,
+            (System.currentTimeMillis() - sendRequestStartTimeMs), TimeUnit.MILLISECONDS);
+        asyncQueryResponse.markRequestSent(serverRoutingInstance);

Review comment:
       You probably don't need to do markRequestSent. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org