Some clean up
This commit is contained in:
parent
7b92c40cbc
commit
00fb29f528
|
@ -7,6 +7,9 @@ import redis.clients.jedis.commands.ProtocolCommand;
|
|||
public class JedisClientDecorator extends DatabaseClientDecorator<ProtocolCommand> {
|
||||
public static final JedisClientDecorator DECORATE = new JedisClientDecorator();
|
||||
|
||||
private static final String SERVICE_NAME = "redis";
|
||||
private static final String COMPONENT_NAME = SERVICE_NAME + "-command";
|
||||
|
||||
@Override
|
||||
protected String[] instrumentationNames() {
|
||||
return new String[] {"jedis", "redis"};
|
||||
|
@ -14,12 +17,12 @@ public class JedisClientDecorator extends DatabaseClientDecorator<ProtocolComman
|
|||
|
||||
@Override
|
||||
protected String service() {
|
||||
return "redis";
|
||||
return SERVICE_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String component() {
|
||||
return "redis-command";
|
||||
return COMPONENT_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,9 +24,6 @@ import redis.clients.jedis.commands.ProtocolCommand;
|
|||
@AutoService(Instrumenter.class)
|
||||
public final class JedisInstrumentation extends Instrumenter.Default {
|
||||
|
||||
private static final String SERVICE_NAME = "redis";
|
||||
private static final String COMPONENT_NAME = SERVICE_NAME + "-command";
|
||||
|
||||
public JedisInstrumentation() {
|
||||
super("jedis", "redis");
|
||||
}
|
||||
|
@ -66,6 +63,8 @@ public final class JedisInstrumentation extends Instrumenter.Default {
|
|||
if (command instanceof Protocol.Command) {
|
||||
DECORATE.onStatement(span, ((Protocol.Command) command).name());
|
||||
} else {
|
||||
// Protocol.Command is the only implementation in the Jedis lib as of 3.1 but this will save
|
||||
// us if that changes
|
||||
DECORATE.onStatement(span, new String(command.getRaw()));
|
||||
}
|
||||
return activateSpan(span, true);
|
||||
|
|
|
@ -6,7 +6,7 @@ import redis.clients.jedis.Jedis
|
|||
import redis.embedded.RedisServer
|
||||
import spock.lang.Shared
|
||||
|
||||
class JedisClientTest extends AgentTestRunner {
|
||||
class Jedis30ClientTest extends AgentTestRunner {
|
||||
|
||||
public static final int PORT = 6399
|
||||
|
||||
|
@ -30,7 +30,7 @@ class JedisClientTest extends AgentTestRunner {
|
|||
|
||||
def cleanupSpec() {
|
||||
redisServer.stop()
|
||||
// jedis.close() // not available in the early version we're using.
|
||||
jedis.close()
|
||||
|
||||
System.clearProperty(Config.PREFIX + Config.DB_CLIENT_HOST_SPLIT_BY_INSTANCE)
|
||||
}
|
Loading…
Reference in New Issue