src/main/java/com/amazonaws/hal/client/HalClient.java
private <T> T invoke(HttpMethodName httpMethodName, String resourcePath, Object representation,
                         HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler)
            throws AmazonClientException {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = buildRequest(httpMethodName, resourcePath, representation);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.CredentialsRequestTime.name());
        AWSCredentials credentials = awsCredentialsProvider.getCredentials();
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.CredentialsRequestTime.name());

        executionContext.setCredentials(credentials);

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime.name());
        Response<T> response = client.execute(request, responseHandler, errorResponseHandler, executionContext);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.ClientExecuteTime.name());

        awsRequestMetrics.log();

        return response.getAwsResponse();
    }
private <T> T invoke(HttpMethodName httpMethodName, String resourcePath, Object representation,
                         HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler)
            throws AmazonClientException {
        ExecutionContext executionContext = createExecutionContext();
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());
        Request request = buildRequest(httpMethodName, resourcePath, representation);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.RequestMarshallTime.name());

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.CredentialsRequestTime.name());
        AWSCredentials credentials = awsCredentialsProvider.getCredentials();
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.CredentialsRequestTime.name());

        executionContext.setCredentials(credentials);

        awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime.name());
        Response<T> response = client.execute(request, responseHandler, errorResponseHandler, executionContext);
        awsRequestMetrics.endEvent(AWSRequestMetrics.Field.ClientExecuteTime.name());

        awsRequestMetrics.log();

        return response.getAwsResponse();
    }
private < T > T invoke ( HttpMethodName httpMethodName , String resourcePath , Object representation , HttpResponseHandler < AmazonWebServiceResponse < T > > responseHandler ) throws AmazonClientException { ExecutionContext executionContext = createExecutionContext ( ) ; AWSRequestMetrics awsRequestMetrics = executionContext . getAwsRequestMetrics ( ) ; awsRequestMetrics . startEvent ( AWSRequestMetrics . Field . RequestMarshallTime . name ( ) ) ; Request request = buildRequest ( httpMethodName , resourcePath , representation ) ; awsRequestMetrics . endEvent ( AWSRequestMetrics . Field . RequestMarshallTime . name ( ) ) ; awsRequestMetrics . startEvent ( AWSRequestMetrics . Field . CredentialsRequestTime . name ( ) ) ; AWSCredentials credentials = awsCredentialsProvider . getCredentials ( ) ; awsRequestMetrics . endEvent ( AWSRequestMetrics . Field . CredentialsRequestTime . name ( ) ) ; executionContext . setCredentials ( credentials ) ; awsRequestMetrics . startEvent ( AWSRequestMetrics . Field . ClientExecuteTime . name ( ) ) ; Response < T > response = client . execute ( request , responseHandler , errorResponseHandler , executionContext ) ; awsRequestMetrics . endEvent ( AWSRequestMetrics . Field . ClientExecuteTime . name ( ) ) ; awsRequestMetrics . log ( ) ; return response . getAwsResponse ( ) ; }
-------------------------------------------------------------
-------------------------------------------------------------