}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
try {
if ("getConnection".equals(method.getName())) {
ServiceLatencyProvider latencyProvider = new ServiceLatencyProvider(
AWSServiceMetrics.HttpClientGetConnectionTime);
try {
return method.invoke(orig, args);
} finally {
AwsSdkMetrics.getServiceMetricCollector()
.collectLatency(latencyProvider.endTiming());
}
}
return method.invoke(orig, args);
} catch (InvocationTargetException e) {
log.debug("", e);