/** * Returns the client specific request metric collector if there is one; or the one at the AWS * SDK level otherwise. */ private RequestMetricCollector requestMetricCollector() { return clientLevelMetricCollector != null ? clientLevelMetricCollector : AwsSdkMetrics.getRequestMetricCollector(); }
/** * Returns the client specific request metric collector if there is one; or * the one at the AWS SDK level otherwise. */ protected RequestMetricCollector requestMetricCollector() { RequestMetricCollector mc = client.getRequestMetricCollector(); return mc == null ? AwsSdkMetrics.getRequestMetricCollector() : mc; }
/** * Returns the most specific request metric collector, starting from the request level, then * client level, then finally the AWS SDK level. */ private RequestMetricCollector findRequestMetricCollector(RequestConfig requestConfig) { RequestMetricCollector reqLevelMetricsCollector = requestConfig .getRequestMetricsCollector(); if (reqLevelMetricsCollector != null) { return reqLevelMetricsCollector; } else if (clientLevelMetricCollector != null) { return clientLevelMetricCollector; } else { return AwsSdkMetrics.getRequestMetricCollector(); } } }
/** * Returns the most specific request metric collector, starting from the request level, then * client level, then finally the AWS SDK level. */ private final RequestMetricCollector findRequestMetricCollector( RequestMetricCollector reqLevelMetricsCollector) { RequestMetricCollector requestMetricCollector; if (reqLevelMetricsCollector != null) { requestMetricCollector = reqLevelMetricsCollector; } else if (getRequestMetricsCollector() != null) { requestMetricCollector = getRequestMetricsCollector(); } else { requestMetricCollector = AwsSdkMetrics.getRequestMetricCollector(); } return requestMetricCollector; }
/** * Returns the client specific request metric collector if there is one; or the one at the AWS * SDK level otherwise. */ private RequestMetricCollector requestMetricCollector() { return clientLevelMetricCollector != null ? clientLevelMetricCollector : AwsSdkMetrics.getRequestMetricCollector(); }
/** * Returns the client specific request metric collector if there is one; or * the one at the AWS SDK level otherwise. */ protected RequestMetricCollector requestMetricCollector() { RequestMetricCollector mc = client.getRequestMetricCollector(); return mc == null ? AwsSdkMetrics.getRequestMetricCollector() : mc; }
/** * @return the client specific request metric collector if there is one; or * the one at the AWS SDK level otherwise. * * @deprecated metrics is deprecated */ @Deprecated protected RequestMetricCollector requestMetricCollector() { final RequestMetricCollector mc = client.getRequestMetricCollector(); return mc == null ? AwsSdkMetrics.getRequestMetricCollector() : mc; }
/** * Returns the most specific request metric collector, starting from the request level, then * client level, then finally the AWS SDK level. */ private RequestMetricCollector findRequestMetricCollector(RequestConfig requestConfig) { RequestMetricCollector reqLevelMetricsCollector = requestConfig .getRequestMetricsCollector(); if (reqLevelMetricsCollector != null) { return reqLevelMetricsCollector; } else if (clientLevelMetricCollector != null) { return clientLevelMetricCollector; } else { return AwsSdkMetrics.getRequestMetricCollector(); } } }
/** * @return the most specific request metric collector, starting from the * request level, then client level, then finally the AWS SDK level. * * @deprecated metrics is deprecated */ @Deprecated protected final RequestMetricCollector findRequestMetricCollector(final Request<?> req) { final AmazonWebServiceRequest origReq = req.getOriginalRequest(); RequestMetricCollector mc = origReq.getRequestMetricCollector(); if (mc != null) { return mc; } mc = getRequestMetricsCollector(); return mc == null ? AwsSdkMetrics.getRequestMetricCollector() : mc; }
/** * Returns the most specific request metric collector, starting from the request level, then * client level, then finally the AWS SDK level. */ private final RequestMetricCollector findRequestMetricCollector( RequestMetricCollector reqLevelMetricsCollector) { RequestMetricCollector requestMetricCollector; if (reqLevelMetricsCollector != null) { requestMetricCollector = reqLevelMetricsCollector; } else if (getRequestMetricsCollector() != null) { requestMetricCollector = getRequestMetricsCollector(); } else { requestMetricCollector = AwsSdkMetrics.getRequestMetricCollector(); } return requestMetricCollector; }
/** * Returns the client specific request metric collector if there is one; or the one at the AWS * SDK level otherwise. */ private RequestMetricCollector requestMetricCollector() { return clientLevelMetricCollector != null ? clientLevelMetricCollector : AwsSdkMetrics.getRequestMetricCollector(); }
/** * @return the client specific request metric collector if there is one; or * the one at the AWS SDK level otherwise. * * @deprecated metrics is deprecated */ @Deprecated protected RequestMetricCollector requestMetricCollector() { final RequestMetricCollector mc = client.getRequestMetricCollector(); return mc == null ? AwsSdkMetrics.getRequestMetricCollector() : mc; }
/** * @return the client specific request metric collector if there is one; or * the one at the AWS SDK level otherwise. * * @deprecated metrics is deprecated */ @Deprecated protected RequestMetricCollector requestMetricCollector() { final RequestMetricCollector mc = client.getRequestMetricCollector(); return mc == null ? AwsSdkMetrics.getRequestMetricCollector() : mc; }
/** * Returns the client specific request metric collector if there is one; or * the one at the AWS SDK level otherwise. */ protected RequestMetricCollector requestMetricCollector() { RequestMetricCollector mc = client.getRequestMetricCollector(); return mc == null ? AwsSdkMetrics.getRequestMetricCollector() : mc; }
/** * Returns the most specific request metric collector, starting from the request level, then * client level, then finally the AWS SDK level. */ private RequestMetricCollector findRequestMetricCollector(RequestConfig requestConfig) { RequestMetricCollector reqLevelMetricsCollector = requestConfig .getRequestMetricsCollector(); if (reqLevelMetricsCollector != null) { return reqLevelMetricsCollector; } else if (clientLevelMetricCollector != null) { return clientLevelMetricCollector; } else { return AwsSdkMetrics.getRequestMetricCollector(); } } }
@Test public void test() { // by default, it's disabled assertFalse(AwsSdkMetrics.isDefaultMetricsEnabled()); // won't be anble to enable unless the default impl library is on the // classpath assertFalse(AwsSdkMetrics.enableDefaultMetrics()); assertFalse(AwsSdkMetrics.isDefaultMetricsEnabled()); assertSame(RequestMetricCollector.NONE, AwsSdkMetrics.getRequestMetricCollector()); assertFalse(AwsSdkMetrics.isDefaultMetricsEnabled()); // effectively no effect AwsSdkMetrics.disableMetrics(); assertFalse(AwsSdkMetrics.isDefaultMetricsEnabled()); }
/** * @return the most specific request metric collector, starting from the * request level, then client level, then finally the AWS SDK level. * * @deprecated metrics is deprecated */ @Deprecated protected final RequestMetricCollector findRequestMetricCollector(final Request<?> req) { final AmazonWebServiceRequest origReq = req.getOriginalRequest(); RequestMetricCollector mc = origReq.getRequestMetricCollector(); if (mc != null) { return mc; } mc = getRequestMetricsCollector(); return mc == null ? AwsSdkMetrics.getRequestMetricCollector() : mc; }
/** * @return the most specific request metric collector, starting from the * request level, then client level, then finally the AWS SDK level. * * @deprecated metrics is deprecated */ @Deprecated protected final RequestMetricCollector findRequestMetricCollector(final Request<?> req) { final AmazonWebServiceRequest origReq = req.getOriginalRequest(); RequestMetricCollector mc = origReq.getRequestMetricCollector(); if (mc != null) { return mc; } mc = getRequestMetricsCollector(); return mc == null ? AwsSdkMetrics.getRequestMetricCollector() : mc; }
/** * Returns the most specific request metric collector, starting from the request level, then * client level, then finally the AWS SDK level. */ private final RequestMetricCollector findRequestMetricCollector( RequestMetricCollector reqLevelMetricsCollector) { if (reqLevelMetricsCollector != null) { return reqLevelMetricsCollector; } else if (getRequestMetricsCollector() != null) { return getRequestMetricsCollector(); } else { return AwsSdkMetrics.getRequestMetricCollector(); } }