This is an automated email from the ASF dual-hosted git repository.

zuston pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/uniffle.git


The following commit(s) were added to refs/heads/master by this push:
     new 6356e4290 feat(client): Log show the bytes length for each data RPC
6356e4290 is described below

commit 6356e4290f9ddf1b0b3de2b762a8809a0c1a21d6
Author: Junfan Zhang <[email protected]>
AuthorDate: Thu Jun 12 19:15:12 2025 +0800

    feat(client): Log show the bytes length for each data RPC
    
    ### What changes were proposed in this pull request?
    
    Take with bytes for data RPC
    
    ### Why are the changes needed?
    
    For inspecting the latency for RPC with concrate data bytes
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Neen't
---
 .../client/impl/grpc/ShuffleServerGrpcClient.java  | 33 +++++++++++-----------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git 
a/internal-client/src/main/java/org/apache/uniffle/client/impl/grpc/ShuffleServerGrpcClient.java
 
b/internal-client/src/main/java/org/apache/uniffle/client/impl/grpc/ShuffleServerGrpcClient.java
index d2537e839..80600d36c 100644
--- 
a/internal-client/src/main/java/org/apache/uniffle/client/impl/grpc/ShuffleServerGrpcClient.java
+++ 
b/internal-client/src/main/java/org/apache/uniffle/client/impl/grpc/ShuffleServerGrpcClient.java
@@ -969,15 +969,15 @@ public class ShuffleServerGrpcClient extends GrpcClient 
implements ShuffleServer
     RssGetShuffleDataResponse response;
     switch (rpcResponse.getStatus()) {
       case SUCCESS:
+        byte[] data = rpcResponse.getData().toByteArray();
         LOG.info(
-            "GetShuffleData from {}:{} for {} cost {} ms",
+            "GetShuffleData from {}:{} for {} cost {} ms with {} bytes",
             host,
             port,
             requestInfo,
-            System.currentTimeMillis() - start);
-        response =
-            new RssGetShuffleDataResponse(
-                StatusCode.SUCCESS, 
ByteBuffer.wrap(rpcResponse.getData().toByteArray()));
+            System.currentTimeMillis() - start,
+            data.length);
+        response = new RssGetShuffleDataResponse(StatusCode.SUCCESS, 
ByteBuffer.wrap(data));
         break;
       default:
         String msg =
@@ -1028,17 +1028,18 @@ public class ShuffleServerGrpcClient extends GrpcClient 
implements ShuffleServer
     RssGetShuffleIndexResponse response;
     switch (rpcResponse.getStatus()) {
       case SUCCESS:
+        byte[] data = rpcResponse.getIndexData().toByteArray();
         LOG.info(
-            "GetShuffleIndex from {}:{} for {} cost {} ms",
+            "GetShuffleIndex from {}:{} for {} cost {} ms with {} bytes",
             host,
             port,
             requestInfo,
-            System.currentTimeMillis() - start);
+            System.currentTimeMillis() - start,
+            data.length);
         response =
             new RssGetShuffleIndexResponse(
                 StatusCode.SUCCESS,
-                new NettyManagedBuffer(
-                    
Unpooled.wrappedBuffer(rpcResponse.getIndexData().toByteArray())),
+                new NettyManagedBuffer(Unpooled.wrappedBuffer(data)),
                 rpcResponse.getDataFileLen(),
                 
rpcResponse.getStorageIdsList().stream().mapToInt(Integer::intValue).toArray());
 
@@ -1105,18 +1106,18 @@ public class ShuffleServerGrpcClient extends GrpcClient 
implements ShuffleServer
     RssGetInMemoryShuffleDataResponse response;
     switch (rpcResponse.getStatus()) {
       case SUCCESS:
+        byte[] data = rpcResponse.getData().toByteArray();
         LOG.info(
-            "GetInMemoryShuffleData from {}:{} for "
-                + requestInfo
-                + " cost "
-                + (System.currentTimeMillis() - start)
-                + " ms",
+            "GetInMemoryShuffleData from {}:{} for {} cost {} ms with {} 
bytes",
             host,
-            port);
+            port,
+            requestInfo,
+            System.currentTimeMillis() - start,
+            data.length);
         response =
             new RssGetInMemoryShuffleDataResponse(
                 StatusCode.SUCCESS,
-                ByteBuffer.wrap(rpcResponse.getData().toByteArray()),
+                ByteBuffer.wrap(data),
                 
toBufferSegments(rpcResponse.getShuffleDataBlockSegmentsList()));
         break;
       default:

Reply via email to