protected Connection getConnectionAndInitInvokeContext(Url url, InvokeContext invokeContext)
                                                                                                throws RemotingException,
                                                                                                InterruptedException {
        long start = System.currentTimeMillis();
        long startInNano = System.nanoTime();
        Connection conn;
        try {
            conn = this.connectionManager.getAndCreateIfAbsent(url);
        } finally {
            if (null != invokeContext) {
                invokeContext.putIfAbsent(InvokeContext.CLIENT_CONN_CREATETIME,
                    (System.currentTimeMillis() - start));
                invokeContext.putIfAbsent(InvokeContext.CLIENT_CONN_CREATE_START_IN_NANO,
                    startInNano);
                invokeContext.putIfAbsent(InvokeContext.CLIENT_CONN_CREATE_END_IN_NANO,
                    System.nanoTime());
            }
        }
        return conn;
    }
Get connection and set init invokeContext if invokeContext not {@code null}

@param url target url
@param invokeContext invoke context to set
@return connection
src/main/java/com/alipay/remoting/rpc/RpcClientRemoting.java