You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uniffle.apache.org by ro...@apache.org on 2022/07/16 08:27:27 UTC

[incubator-uniffle] branch master updated: [Improvement] Log indicate the shuffle server host:port when doing remote calling (#58)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new e48f74e  [Improvement] Log indicate the shuffle server host:port when doing remote calling (#58)
e48f74e is described below

commit e48f74ee657eca1c6dc05d558d88525c01733c3a
Author: Junfan Zhang <ju...@outlook.com>
AuthorDate: Sat Jul 16 16:27:23 2022 +0800

    [Improvement] Log indicate the shuffle server host:port when doing remote calling (#58)
    
    ### What changes were proposed in this pull request?
    Log indicate the shuffle server host:port when calling remote shuffle servers
    
    ### Why are the changes needed?
    Sometimes i want to look which shuffle server remote call cost the most time, but the current log can't help me find it.
    If having this log, i will find slowest server and then to look its disk io metrics.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    No need
---
 .../client/impl/grpc/ShuffleServerGrpcClient.java     | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 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 7c5beaf..fed8c92 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
@@ -258,8 +258,8 @@ public class ShuffleServerGrpcClient extends GrpcClient implements ShuffleServer
             .build();
         long start = System.currentTimeMillis();
         SendShuffleDataResponse response = doSendData(rpcRequest);
-        LOG.info("Do sendShuffleData rpc cost:" + (System.currentTimeMillis() - start)
-            + " ms for " + size + " bytes with " + blockNum + " blocks");
+        LOG.info("Do sendShuffleData to {}:{} rpc cost:" + (System.currentTimeMillis() - start)
+            + " ms for " + size + " bytes with " + blockNum + " blocks", host, port);
 
         if (response.getStatus() != StatusCode.SUCCESS) {
           String msg = "Can't send shuffle data with " + blockNum
@@ -337,6 +337,7 @@ public class ShuffleServerGrpcClient extends GrpcClient implements ShuffleServer
   public RssFinishShuffleResponse finishShuffle(RssFinishShuffleRequest request) {
     FinishShuffleRequest rpcRequest = FinishShuffleRequest.newBuilder()
         .setAppId(request.getAppId()).setShuffleId(request.getShuffleId()).build();
+    long start = System.currentTimeMillis();
     FinishShuffleResponse rpcResponse = blockingStub.finishShuffle(rpcRequest);
 
     RssFinishShuffleResponse response;
@@ -347,6 +348,10 @@ public class ShuffleServerGrpcClient extends GrpcClient implements ShuffleServer
       LOG.error(msg);
       throw new RssException(msg);
     } else {
+      String requestInfo = "appId[" + request.getAppId() + "], shuffleId["
+          + request.getShuffleId() + "]";
+      LOG.info("FinishShuffle to {}:{} for {} cost {} ms", host, port, requestInfo,
+          System.currentTimeMillis() - start);
       response = new RssFinishShuffleResponse(ResponseStatusCode.SUCCESS);
     }
     return response;
@@ -457,7 +462,8 @@ public class ShuffleServerGrpcClient extends GrpcClient implements ShuffleServer
     GetLocalShuffleDataResponse rpcResponse = blockingStub.getLocalShuffleData(rpcRequest);
     String requestInfo = "appId[" + request.getAppId() + "], shuffleId["
         + request.getShuffleId() + "], partitionId[" + request.getPartitionId() + "]";
-    LOG.info("GetShuffleData for " + requestInfo + " cost " + (System.currentTimeMillis() - start) + " ms");
+    LOG.info("GetShuffleData from {}:{} for {} cost {} ms", host, port, requestInfo,
+        System.currentTimeMillis() - start);
 
     StatusCode statusCode = rpcResponse.getStatus();
 
@@ -491,7 +497,8 @@ public class ShuffleServerGrpcClient extends GrpcClient implements ShuffleServer
     GetLocalShuffleIndexResponse rpcResponse = blockingStub.getLocalShuffleIndex(rpcRequest);
     String requestInfo = "appId[" + request.getAppId() + "], shuffleId["
         + request.getShuffleId() + "], partitionId[" + request.getPartitionId() + "]";
-    LOG.info("GetShuffleIndex for " + requestInfo + " cost " + (System.currentTimeMillis() - start) + " ms");
+    LOG.info("GetShuffleIndex from {}:{} for {} cost {} ms", host, port,
+        requestInfo, System.currentTimeMillis() - start);
 
     StatusCode statusCode = rpcResponse.getStatus();
 
@@ -527,8 +534,8 @@ public class ShuffleServerGrpcClient extends GrpcClient implements ShuffleServer
     GetMemoryShuffleDataResponse rpcResponse = blockingStub.getMemoryShuffleData(rpcRequest);
     String requestInfo = "appId[" + request.getAppId() + "], shuffleId["
         + request.getShuffleId() + "], partitionId[" + request.getPartitionId() + "]";
-    LOG.info("GetInMemoryShuffleData for " + requestInfo + " cost "
-        + (System.currentTimeMillis() - start) + " ms");
+    LOG.info("GetInMemoryShuffleData from {}:{} for " + requestInfo + " cost "
+        + (System.currentTimeMillis() - start) + " ms", host, port);
 
     StatusCode statusCode = rpcResponse.getStatus();