use of com.navercorp.pinpoint.plugin.redis.lettuce.EndPointAccessor in project pinpoint by naver.
the class AttachEndPointInterceptor method after.
@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
if (isDebug) {
logger.afterInterceptor(target, args, result, throwable);
}
try {
if (!validate(target, result)) {
return;
}
final String endPoint = ((EndPointAccessor) target)._$PINPOINT$_getEndPoint();
if (result instanceof CompletableFuture) {
StatefulRedisClusterConnectionImpl statefulRedisClusterConnection = (StatefulRedisClusterConnectionImpl) ((CompletableFuture) result).get();
((EndPointAccessor) statefulRedisClusterConnection)._$PINPOINT$_setEndPoint(endPoint);
return;
}
((EndPointAccessor) result)._$PINPOINT$_setEndPoint(endPoint);
} catch (Throwable t) {
if (logger.isWarnEnabled()) {
logger.warn("Failed to AFTER process. {}", t.getMessage(), t);
}
}
}
use of com.navercorp.pinpoint.plugin.redis.lettuce.EndPointAccessor in project pinpoint by naver.
the class RedisClientConstructorInterceptor method before.
@Override
public void before(Object target, Object[] args) {
if (isDebug) {
logger.beforeInterceptor(target, args);
}
try {
if (!validate(target, args)) {
return;
}
final RedisURI redisURI = (RedisURI) args[1];
final String endPoint = HostAndPort.toHostAndPortString(redisURI.getHost(), redisURI.getPort());
((EndPointAccessor) target)._$PINPOINT$_setEndPoint(endPoint);
} catch (Throwable t) {
if (logger.isWarnEnabled()) {
logger.warn("Failed to BEFORE process. {}", t.getMessage(), t);
}
}
}
Aggregations