Copilot commented on code in PR #17422:
URL: https://github.com/apache/pinot/pull/17422#discussion_r2644303531
##########
pinot-broker/src/main/java/org/apache/pinot/broker/grpc/BrokerGrpcServer.java:
##########
@@ -278,17 +279,22 @@ public void submit(Broker.BrokerRequest request,
throw new RuntimeException(e);
}
responseObserver.onNext(emptyOrErrorBlock);
+ _brokerMetrics.addMeteredGlobalValue(BrokerMeter.GRPC_BYTES_SENT,
emptyOrErrorBlock.getSerializedSize());
responseObserver.onCompleted();
return;
}
// Handle query response:
+ // Track total bytes sent for metrics
+ long totalBytesSent = 0;
Review Comment:
The variable `totalBytesSent` is only needed when there's a successful
result table response. Consider declaring it closer to where it's used (after
the result table null check at line 285) to reduce its scope and make the code
more maintainable.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]