Search in sources :

Example 1 with NameIntValuePair

use of com.navercorp.pinpoint.bootstrap.pair.NameIntValuePair in project pinpoint by naver.

the class HttpRequestExecutorExecuteMethodInterceptor method getHost.

private NameIntValuePair<String> getHost() {
    final InterceptorScopeInvocation transaction = interceptorScope.getCurrentInvocation();
    final Object attachment = getAttachment(transaction);
    if (attachment instanceof HttpCallContext) {
        HttpCallContext callContext = (HttpCallContext) attachment;
        return new NameIntValuePair<>(callContext.getHost(), callContext.getPort());
    }
    return new NameIntValuePair<>(null, -1);
}
Also used : InterceptorScopeInvocation(com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation) HttpCallContext(com.navercorp.pinpoint.plugin.httpclient4.HttpCallContext) NameIntValuePair(com.navercorp.pinpoint.bootstrap.pair.NameIntValuePair)

Example 2 with NameIntValuePair

use of com.navercorp.pinpoint.bootstrap.pair.NameIntValuePair in project pinpoint by naver.

the class DefaultClientExchangeHandlerImplStartMethodInterceptor method getHost.

private NameIntValuePair<String> getHost(final Object target) {
    if (target instanceof RequestProducerGetter) {
        final HttpAsyncRequestProducer producer = ((RequestProducerGetter) target)._$PINPOINT$_getRequestProducer();
        final HttpHost httpHost = producer.getTarget();
        if (httpHost != null) {
            return new NameIntValuePair<>(httpHost.getHostName(), httpHost.getPort());
        }
    }
    return new NameIntValuePair<>(null, -1);
}
Also used : NameIntValuePair(com.navercorp.pinpoint.bootstrap.pair.NameIntValuePair) RequestProducerGetter(com.navercorp.pinpoint.plugin.httpclient4.RequestProducerGetter) HttpAsyncRequestProducer(org.apache.http.nio.protocol.HttpAsyncRequestProducer) HttpHost(org.apache.http.HttpHost)

Aggregations

NameIntValuePair (com.navercorp.pinpoint.bootstrap.pair.NameIntValuePair)2 InterceptorScopeInvocation (com.navercorp.pinpoint.bootstrap.interceptor.scope.InterceptorScopeInvocation)1 HttpCallContext (com.navercorp.pinpoint.plugin.httpclient4.HttpCallContext)1 RequestProducerGetter (com.navercorp.pinpoint.plugin.httpclient4.RequestProducerGetter)1 HttpHost (org.apache.http.HttpHost)1 HttpAsyncRequestProducer (org.apache.http.nio.protocol.HttpAsyncRequestProducer)1