Example usage for com.amazonaws.util AWSRequestMetrics startEvent

List of usage examples for com.amazonaws.util AWSRequestMetrics startEvent

Introduction

In this page you can find the example usage for com.amazonaws.util AWSRequestMetrics startEvent.

Prototype

public void startEvent(MetricType f) 

Source Link

Usage

From source file:com.github.sjones4.youcan.youserv.YouServClient.java

License:Open Source License

@Override
public DescribeServicesResult describeServices(final DescribeServicesRequest describeServicesRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(describeServicesRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<DescribeServicesRequest> request = null;
    Response<DescribeServicesResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {// w w w  .  java 2  s. co m
        request = new DescribeServicesRequestMarshaller().marshall(describeServicesRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new DescribeServicesResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youserv.YouServClient.java

License:Open Source License

@Override
public DescribeServiceCertificatesResult describeServiceCertificates(
        final DescribeServiceCertificatesRequest describeServiceCertificatesRequest)
        throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(describeServiceCertificatesRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<DescribeServiceCertificatesRequest> request = null;
    Response<DescribeServiceCertificatesResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {/*from   ww  w. j  a v a 2 s  .  com*/
        request = new DescribeServiceCertificatesRequestMarshaller()
                .marshall(describeServiceCertificatesRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new DescribeServiceCertificatesResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youtoken.YouTokenClient.java

License:Open Source License

@Override
public GetAccessTokenResult getAccessToken(final GetAccessTokenRequest getAccessTokenRequest)
        throws AmazonServiceException, AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(getAccessTokenRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<GetAccessTokenRequest> request = null;
    Response<GetAccessTokenResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {//from w w  w. j  a  va  2 s.  c o m
        request = new GetAccessTokenRequestMarshaller().marshall(getAccessTokenRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new GetAccessTokenResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youtoken.YouTokenClient.java

License:Open Source License

@Override
public GetImpersonationTokenResult getImpersonationToken(
        final GetImpersonationTokenRequest getImpersonationTokenRequest)
        throws AmazonServiceException, AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(getImpersonationTokenRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<GetImpersonationTokenRequest> request = null;
    Response<GetImpersonationTokenResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {/*  w  ww .  ja  v a 2 s . c  om*/
        request = new GetImpersonationTokenRequestMarshaller().marshall(getImpersonationTokenRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new GetImpersonationTokenResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}

From source file:com.github.sjones4.youcan.youtwo.YouTwoClient.java

License:Open Source License

public DescribeInstanceTypesResult describeInstanceTypes(
        DescribeInstanceTypesRequest describeInstanceTypesRequest) throws AmazonClientException {
    ExecutionContext executionContext = createExecutionContext(describeInstanceTypesRequest);
    AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
    Request<DescribeInstanceTypesRequest> request = null;
    Response<DescribeInstanceTypesResult> response = null;
    awsRequestMetrics.startEvent(AWSRequestMetrics.Field.ClientExecuteTime);
    try {/*  w  w  w .  jav a 2  s.c  o  m*/
        request = new DescribeInstanceTypesRequestMarshaller().marshall(describeInstanceTypesRequest);
        // Binds the request metrics to the current request.
        request.setAWSRequestMetrics(awsRequestMetrics);
        response = invoke(request, new DescribeInstanceTypesResultStaxUnmarshaller(), executionContext);
        return response.getAwsResponse();
    } finally {
        endClientExecution(awsRequestMetrics, request, response);
    }
}