diff --git a/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java b/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java index f179bad1f4b155fc44d21df4338169520446b63f..5a36e18b0981162c02dd2f0f210c414abd8c8cde 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java +++ b/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java @@ -123,7 +123,10 @@ public class TransportClientFactory implements Closeable { public TransportClient createClient(String remoteHost, int remotePort) throws IOException { // Get connection from the connection pool first. // If it is not found or not active, create a new one. + long preResolveHost = System.nanoTime(); final InetSocketAddress address = new InetSocketAddress(remoteHost, remotePort); + long hostResolveTimeMs = (System.nanoTime() - preResolveHost) / 1000000; + logger.info("Spent {} ms to resolve {}", hostResolveTimeMs, address); // Create the ClientPool if we don't have it yet. ClientPool clientPool = connectionPool.get(address); @@ -235,7 +238,7 @@ public class TransportClientFactory implements Closeable { } long postBootstrap = System.nanoTime(); - logger.debug("Successfully created connection to {} after {} ms ({} ms spent in bootstraps)", + logger.info("Successfully created connection to {} after {} ms ({} ms spent in bootstraps)", address, (postBootstrap - preConnect) / 1000000, (postBootstrap - preBootstrap) / 1000000); return client;