Skip to content

Commit

Permalink
Rename lettuce 4.3 instrumentation classes per standard
Browse files Browse the repository at this point in the history
  • Loading branch information
twcrone committed Jun 6, 2022
1 parent a581d94 commit 1ff6734
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
import com.newrelic.api.agent.NewRelic;
import com.newrelic.api.agent.Segment;
import com.newrelic.api.agent.Trace;
import com.newrelic.api.agent.weaver.MatchType;
import com.newrelic.api.agent.weaver.Weave;
import com.newrelic.api.agent.weaver.Weaver;
import com.nr.lettuce43.instrumentation.NRBiConsumer;

@Weave(type = MatchType.BaseClass)
public abstract class AbstractRedisAsyncCommands<K, V> {
@Weave(originalName = "com.lambdaworks.redis.AbstractRedisAsyncCommands")
public abstract class AbstractRedisAsyncCommands_Instrumentation<K, V> {

public abstract StatefulConnection<K, V> getConnection();

Expand All @@ -32,8 +31,8 @@ public <T> AsyncCommand<K, V, T> dispatch(RedisCommand<K, V, T> cmd) {
RedisURI uri = null;

StatefulConnection<K, V> conn = getConnection();
if (StatefulRedisConnectionImpl.class.isInstance(conn)) {
StatefulRedisConnectionImpl<K, V> connImpl = (StatefulRedisConnectionImpl<K, V>) conn;
if (StatefulRedisConnectionImpl_Instrumentation.class.isInstance(conn)) {
StatefulRedisConnectionImpl_Instrumentation<K, V> connImpl = (StatefulRedisConnectionImpl_Instrumentation<K, V>) conn;
if (connImpl.redisURI != null) {
uri = connImpl.redisURI;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public static RedisClient_instrumentation create(String uri) {

public abstract StatefulRedisConnection<String, String> connect();

protected <K, V> StatefulRedisConnectionImpl<K, V> newStatefulRedisConnection(CommandHandler<K, V> commandHandler,
protected <K, V> StatefulRedisConnectionImpl_Instrumentation<K, V> newStatefulRedisConnection(CommandHandler<K, V> commandHandler,
RedisCodec<K, V> codec, long timeout, TimeUnit unit) {
StatefulRedisConnectionImpl<K, V> connection = Weaver.callOriginal();
StatefulRedisConnectionImpl_Instrumentation<K, V> connection = Weaver.callOriginal();
connection.redisURI = redisURI;
return connection;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

import java.util.concurrent.TimeUnit;

@Weave(type = MatchType.BaseClass)
public abstract class StatefulRedisConnectionImpl<K, V> implements StatefulConnection<K, V> {
@Weave(originalName = "com.lambdaworks.redis.StatefulRedisConnectionImpl")
public abstract class StatefulRedisConnectionImpl_Instrumentation<K, V> implements StatefulConnection<K, V> {

@NewField
public RedisURI redisURI = null;

public StatefulRedisConnectionImpl(RedisChannelWriter<K, V> writer, RedisCodec<K, V> codec, long timeout,
public StatefulRedisConnectionImpl_Instrumentation(RedisChannelWriter<K, V> writer, RedisCodec<K, V> codec, long timeout,
TimeUnit unit) {

}
Expand Down

0 comments on commit 1ff6734

Please sign in to comment.