@SuppressWarnings("deprecation") @Override public void afterResponse(Request<?> request, Response<?> response) { AWSRequestMetrics awsRequestMetrics = request == null ? null : request .getAWSRequestMetrics(); Object awsResponse = response == null ? null : response .getAwsResponse(); TimingInfo timingInfo = awsRequestMetrics == null ? null : awsRequestMetrics.getTimingInfo(); old.afterResponse(request, awsResponse, timingInfo); }
private ApiCallMonitoringEvent generateApiCallMonitoringEvent(Request<?> request, Exception e) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request); AWSRequestMetrics metrics = request.getAWSRequestMetrics(); if (e instanceof ClientExecutionTimeoutException) { event.withApiCallTimeout(1); } if (metrics != null && !CollectionUtils.isNullOrEmpty(metrics.getProperty(MaxRetriesExceeded))) { boolean maxRetriesExceeded = (Boolean) metrics.getProperty(MaxRetriesExceeded).get(0); event.withMaxRetriesExceeded(maxRetriesExceeded ? 1 : 0); } return event; }
private void collectMetrics0(Request<?> request, Response<?> response) { AWSRequestMetrics arm = request.getAWSRequestMetrics(); if (arm == null || !arm.isEnabled()) { return; } for (MetricType type: AwsSdkMetrics.getPredefinedMetrics()) { if (!(type instanceof RequestMetricType)) continue; PredefinedMetricTransformer transformer = getTransformer(); for (MetricDatum datum : transformer.toMetricData(type, request, response)) { try { if (!addMetricsToQueue(datum)) { if (log.isDebugEnabled()) { log.debug("Failed to add to the metrics queue (due to no space available) for " + type.name() + ":" + request.getServiceName()); } } } catch(RuntimeException ex) { log.warn("Failed to add to the metrics queue for " + type.name() + ":" + request.getServiceName(), ex); } } } }
AWSRequestMetrics m = req.getAWSRequestMetrics(); TimingInfo ti = m.getTimingInfo();
protected List<MetricDatum> metricOfCount( Field metricType, Request<?> req, Object resp) { AWSRequestMetrics m = req.getAWSRequestMetrics(); TimingInfo ti = m.getTimingInfo(); Number counter = ti.getCounter(metricType.name()); if (counter == null) { return Collections.emptyList(); } final double count = counter.doubleValue(); if (count < 1) { return Collections.emptyList(); } else { return Collections.singletonList(new MetricDatum() .withMetricName(req.getServiceName()) .withDimensions(new Dimension() .withName(Dimensions.MetricType.name()) .withValue(metricType.name())) .withUnit(StandardUnit.Count) .withValue(Double.valueOf(count)) .withTimestamp(endTimestamp(ti))) ; } }
AWSRequestMetrics m = req.getAWSRequestMetrics(); TimingInfo ti = m.getTimingInfo(); final String metricName = type.name();
/** * Returns a request type specific metrics for * {@link Field#ClientExecuteTime} which is special in the sense that it * 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(); }
AWSRequestMetrics m = req.getAWSRequestMetrics(); TimingInfo root = m.getTimingInfo(); final String metricName = metricType.name();
@Override public void collectMetrics(Request<?> request, Response<?> response) AWSRequestMetrics metrics = request.getAWSRequestMetrics();
@SuppressWarnings("deprecation") @Override public void afterResponse(Request<?> request, Response<?> response) { AWSRequestMetrics awsRequestMetrics = request == null ? null : request .getAWSRequestMetrics(); Object awsResponse = response == null ? null : response .getAwsResponse(); TimingInfo timingInfo = awsRequestMetrics == null ? null : awsRequestMetrics.getTimingInfo(); old.afterResponse(request, awsResponse, timingInfo); }
@SuppressWarnings("deprecation") @Override public void afterResponse(Request<?> request, Response<?> response) { AWSRequestMetrics awsRequestMetrics = request == null ? null : request .getAWSRequestMetrics(); Object awsResponse = response == null ? null : response .getAwsResponse(); TimingInfo timingInfo = awsRequestMetrics == null ? null : awsRequestMetrics.getTimingInfo(); old.afterResponse(request, awsResponse, timingInfo); }
Long latency = null; Integer requestCount = 0; AWSRequestMetrics metrics = request.getAWSRequestMetrics();
AWSRequestMetrics metrics = context.getRequest().getAWSRequestMetrics();
private ApiCallMonitoringEvent generateApiCallMonitoringEvent(Request<?> request, Exception e) { ApiCallMonitoringEvent event = generateApiCallMonitoringEvent(request); AWSRequestMetrics metrics = request.getAWSRequestMetrics(); if (e instanceof ClientExecutionTimeoutException) { event.withApiCallTimeout(1); } if (metrics != null && !CollectionUtils.isNullOrEmpty(metrics.getProperty(MaxRetriesExceeded))) { boolean maxRetriesExceeded = (Boolean) metrics.getProperty(MaxRetriesExceeded).get(0); event.withMaxRetriesExceeded(maxRetriesExceeded ? 1 : 0); } return event; }
@SuppressWarnings("deprecation") @Override public void afterResponse(Request<?> request, Response<?> response) { AWSRequestMetrics awsRequestMetrics = request == null ? null : request .getAWSRequestMetrics(); Object awsResponse = response == null ? null : response .getAwsResponse(); TimingInfo timingInfo = awsRequestMetrics == null ? null : awsRequestMetrics.getTimingInfo(); old.afterResponse(request, awsResponse, timingInfo); }
@SuppressWarnings("deprecation") @Override public void afterResponse(Request<?> request, Response<?> response) { AWSRequestMetrics awsRequestMetrics = request == null ? null : request .getAWSRequestMetrics(); Object awsResponse = response == null ? null : response .getAwsResponse(); TimingInfo timingInfo = awsRequestMetrics == null ? null : awsRequestMetrics.getTimingInfo(); old.afterResponse(request, awsResponse, timingInfo); }
@SuppressWarnings("deprecation") @Override public void afterResponse(Request<?> request, Response<?> response) { AWSRequestMetrics awsRequestMetrics = request == null ? null : request .getAWSRequestMetrics(); Object awsResponse = response == null ? null : response .getAwsResponse(); TimingInfo timingInfo = awsRequestMetrics == null ? null : awsRequestMetrics.getTimingInfo(); old.afterResponse(request, awsResponse, timingInfo); }
private Map<String, String> getAllTags(Request<?> request) { final AWSRequestMetrics metrics = request.getAWSRequestMetrics(); final Map<String, String> allTags = new HashMap<>(); for (TagField tag : TAGS) { allTags.put(tag.getName(), tag.getValue(metrics).orElse(UNKNOWN)); } allTags.put(TAG_REQUEST_TYPE, request.getOriginalRequest().getClass().getSimpleName()); final boolean error = isError(metrics); if (error) { for (TagField tag : ERRORS) { allTags.put(tag.getName(), tag.getValue(metrics).orElse(UNKNOWN)); } } allTags.put(TAG_ERROR, Boolean.toString(error)); allTags.putAll(customTags); return Collections.unmodifiableMap(allTags); }
Long latency = null; Integer requestCount = 0; AWSRequestMetrics metrics = request.getAWSRequestMetrics();
AWSRequestMetrics metrics = context.getRequest().getAWSRequestMetrics();