Package com.amazonaws.util

Examples of com.amazonaws.util.TimingInfo


     * makes a more accurate measurement by taking the {@link TimingInfo} at the
     * root into account.
     */
    protected List<MetricDatum> latencyOfClientExecuteTime(Request<?> req, Object response) {
        AWSRequestMetrics m = req.getAWSRequestMetrics();
        TimingInfo root = m.getTimingInfo();
        final String metricName = Field.ClientExecuteTime.name();
        if (root.isEndTimeKnown()) { // being defensive
            List<Dimension> dims = new ArrayList<Dimension>();
            dims.add(new Dimension()
                    .withName(Dimensions.MetricType.name())
                    .withValue(metricName));
            // request type specific
            dims.add(new Dimension()
                    .withName(Dimensions.RequestType.name())
                    .withValue(requestType(req)));
            MetricDatum datum = new MetricDatum()
                .withMetricName(req.getServiceName())
                .withDimensions(dims)
                .withUnit(StandardUnit.Milliseconds)
                .withValue(root.getTimeTakenMillisIfKnown());
            return Collections.singletonList(datum);
        }
        return Collections.emptyList();
    }
View Full Code Here


     *            includes the "request" dimension
     */
    protected List<MetricDatum> counterMetricOf(MetricType type,
            Request<?> req, Object resp, boolean includesRequestType) {
        AWSRequestMetrics m = req.getAWSRequestMetrics();
        TimingInfo ti = m.getTimingInfo();
        final String metricName = type.name();
        Number counter = ti.getCounter(metricName);
        if (counter == null) {
            return Collections.emptyList();
        }
        int count = counter.intValue();
        if (count < 1) {
View Full Code Here

        for ( RequestHandler requestHandler : requestHandlers ) {
            requestHandler.beforeRequest(request);
        }

      try {
        TimingInfo timingInfo = new TimingInfo(startTime);
        executionContext.setTimingInfo(timingInfo);
        T t = executeHelper(request, responseHandler, errorResponseHandler, executionContext);
        timingInfo.setEndTime(System.currentTimeMillis());

      for (RequestHandler handler : requestHandlers) {
        try {
          handler.afterResponse(request, t, timingInfo);
        } catch (ClassCastException cce) {}
View Full Code Here

                retryCount++;

                long start = System.currentTimeMillis();
                response = httpClient.execute(httpRequest);
                long end = System.currentTimeMillis();
                executionContext.getTimingInfo().addSubMeasurement(HTTP_REQUEST_TIME, new TimingInfo(start,end));

                if (isRequestSuccessful(response)) {
                    /*
                     * If we get back any 2xx status code, then we know we should
                     * treat the service call as successful.
View Full Code Here

            AmazonWebServiceResponse<? extends T> awsResponse = responseHandler.handle(httpResponse);
            long endTime = System.currentTimeMillis();

          if (System.getProperty(PROFILING_SYSTEM_PROPERTY) != null) {
              if (executionContext.getTimingInfo() != null) {
                TimingInfo timingInfo = executionContext.getTimingInfo();
                TimingInfo responseProcessingTiming = new TimingInfo(startTime, endTime);
          timingInfo.addSubMeasurement(RESPONSE_PROCESSING_SUBMEASUREMENT, responseProcessingTiming);

                  if (countingInputStream != null) {
                      responseProcessingTiming.addCounter(BYTES_PROCESSED_COUNTER, countingInputStream.getByteCount());
                  }
              }
          }

            if (awsResponse == null)
View Full Code Here

        for ( RequestHandler requestHandler : requestHandlers ) {
            requestHandler.beforeRequest(request);
        }

      try {
        TimingInfo timingInfo = new TimingInfo(startTime);
        executionContext.setTimingInfo(timingInfo);
        T t = executeHelper(request, responseHandler, errorResponseHandler, executionContext);
        timingInfo.setEndTime(System.currentTimeMillis());

      for (RequestHandler handler : requestHandlers) {
        try {
          handler.afterResponse(request, t, timingInfo);
        } catch (ClassCastException cce) {}
View Full Code Here

            AmazonWebServiceResponse<? extends T> awsResponse = responseHandler.handle(httpResponse);
            long endTime = System.currentTimeMillis();

          if (System.getProperty(PROFILING_SYSTEM_PROPERTY) != null) {
              if (executionContext.getTimingInfo() != null) {
                TimingInfo timingInfo = executionContext.getTimingInfo();
                TimingInfo responseProcessingTiming = new TimingInfo(startTime, endTime);
          timingInfo.addSubMeasurement(RESPONSE_PROCESSING_SUBMEASUREMENT, responseProcessingTiming);

                  if (countingInputStream != null) {
                      responseProcessingTiming.addCounter(BYTES_PROCESSED_COUNTER, countingInputStream.getByteCount());
                  }
              }
          }

            if (awsResponse == null)
View Full Code Here

        for ( RequestHandler requestHandler : requestHandlers ) {
            requestHandler.beforeRequest(request);
        }

        try {
            TimingInfo timingInfo = new TimingInfo(startTime);
            T t = executeHelper(request, responseHandler, errorResponseHandler, executionContext);
            timingInfo.setEndTime(System.currentTimeMillis());

            for (RequestHandler handler : requestHandlers) {
                try {
                    handler.afterResponse(request, t, timingInfo);
                } catch (ClassCastException cce) {}
View Full Code Here

        final AWSRequestMetrics metrics = executionContext.getAwsRequestMetrics();
        T response = null;
        try {
            response = executeHelper(request, responseHandler, errorResponseHandler, executionContext);
            TimingInfo timingInfo = metrics.getTimingInfo().endTiming();

            for (RequestHandler handler : requestHandlers) {
                handler.afterResponse(request, response, timingInfo);
            }
            return response;
View Full Code Here

        final AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        Response<T> response = null;
        try {
            response = executeHelper(request, responseHandler, errorResponseHandler, executionContext);
            TimingInfo timingInfo = awsRequestMetrics.getTimingInfo().endTiming();
            afterResponse(request, requestHandler2s, response, timingInfo);
            return response;
        } catch (AmazonClientException e) {
            afterError(request, response, requestHandler2s, e);
            throw e;
View Full Code Here

TOP

Related Classes of com.amazonaws.util.TimingInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.