File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
arex-instrumentation/redis/arex-redis-common/src/main/java/io/arex/inst/redis/common Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 44import io .arex .agent .bootstrap .model .Mocker ;
55
66import io .arex .agent .bootstrap .util .CollectionUtil ;
7+ import io .arex .agent .bootstrap .util .StringUtil ;
78import io .arex .inst .runtime .serializer .Serializer ;
89import io .arex .inst .runtime .util .IgnoreUtils ;
910import io .arex .inst .runtime .util .MockUtils ;
1415
1516public class RedisExtractor {
1617 private static final String SPECIAL_CLASS_NAME = "redis.clients.jedis.BinaryJedis$SetFromList" ;
18+ private static final String DEFAULT_CLUSTER_NAME = "Cluster" ;
1719
1820 private final String clusterName ;
1921 private final String command ;
@@ -89,7 +91,10 @@ static class RedisCluster {
8991 private static final AtomicInteger sequence = new AtomicInteger ();
9092
9193 static String get (String key ) {
92- return REDIS_CLUSTER_CACHE .computeIfAbsent (key , k -> "Cluster" + sequence .addAndGet (1 ));
94+ if (StringUtil .isEmpty (key )){
95+ return DEFAULT_CLUSTER_NAME ;
96+ }
97+ return REDIS_CLUSTER_CACHE .computeIfAbsent (key , k -> DEFAULT_CLUSTER_NAME + sequence .addAndGet (1 ));
9398 }
9499 }
95100}
You can’t perform that action at this time.
0 commit comments