use of okhttp3.internal.connection.RealCall in project bithon by FrankChen021.
the class RealCall$GetResponseWithInterceptorChain method onMethodEnter.
@Override
public InterceptionDecision onMethodEnter(AopContext aopContext) {
Call realCall = (Call) aopContext.getTarget();
Request request = realCall.request();
String uri = request.url().uri().toString().split("\\?")[0];
return needIgnore(uri) ? InterceptionDecision.SKIP_LEAVE : InterceptionDecision.CONTINUE;
}
use of okhttp3.internal.connection.RealCall in project bithon by FrankChen021.
the class RealCall$GetResponseWithInterceptorChain method onMethodLeave.
@Override
public void onMethodLeave(AopContext aopContext) {
Call realCall = (Call) aopContext.getTarget();
Request originRequest = realCall.request();
String requestUri = originRequest.url().uri().toString();
String requestMethod = originRequest.method().toUpperCase(Locale.ENGLISH);
if (aopContext.getException() != null) {
metricRegistry.addExceptionRequest(requestUri, requestMethod, aopContext.getCostTime());
} else {
Response response = aopContext.castReturningAs();
metricRegistry.addRequest(requestUri, requestMethod, response.code(), aopContext.getCostTime());
}
addBytes(requestUri, requestMethod, originRequest, realCall);
}
use of okhttp3.internal.connection.RealCall in project bithon by FrankChen021.
the class RealCall$GetResponseWithInterceptorChain method onMethodEnter.
@Override
public InterceptionDecision onMethodEnter(AopContext aopContext) {
Call realCall = aopContext.castTargetAs();
Request originRequest = realCall.request();
String uri = originRequest.url().uri().toString().split("\\?")[0];
return needIgnore(uri) ? InterceptionDecision.SKIP_LEAVE : InterceptionDecision.CONTINUE;
}
use of okhttp3.internal.connection.RealCall in project cloudant-java-sdk by IBM.
the class SdkTimeoutTest method testBasicAuthTimeout.
@Test
void testBasicAuthTimeout() throws NoSuchFieldException, IllegalAccessException {
BasicAuthenticator basicAuth = new BasicAuthenticator.Builder().username("user").password("psw").build();
CloudantBaseService myService = createCloudantBaseService(basicAuth, "https://cloudant.example");
Request testRequest = createTestRequest(myService);
for (int i = 0; i < 2; i++) {
if (i == 1) {
setCustomTimeout(myService, testCases[i]);
}
RealCall testRequestCall = createServiceCall(myService, testRequest);
assertEquals(TimeUnit.MILLISECONDS.toSeconds(testRequestCall.getClient().readTimeoutMillis()), testCases[i]);
}
}
use of okhttp3.internal.connection.RealCall in project cloudant-java-sdk by IBM.
the class SdkTimeoutTest method testNoAuthTimeout.
// Test implementations
@Test
void testNoAuthTimeout() throws NoSuchFieldException, IllegalAccessException {
NoAuthAuthenticator noAuth = new NoAuthAuthenticator();
CloudantBaseService myService = createCloudantBaseService(noAuth, "https://cloudant.example");
Request testRequest = createTestRequest(myService);
for (int i = 0; i < 2; i++) {
if (i == 1) {
setCustomTimeout(myService, testCases[i]);
}
RealCall testRequestCall = createServiceCall(myService, testRequest);
assertEquals(TimeUnit.MILLISECONDS.toSeconds(testRequestCall.getClient().readTimeoutMillis()), testCases[i]);
}
}
Aggregations