diff --git a/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java b/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java index 81459cd78..dcd7d7335 100644 --- a/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java +++ b/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java @@ -20,14 +20,11 @@ import java.util.function.Function; import redis.clients.jedis.Jedis; import redis.clients.jedis.Pipeline; -import redis.clients.jedis.ScanParams; -import redis.clients.jedis.ScanResult; import redis.clients.jedis.Transaction; -import redis.clients.jedis.commands.BinaryJedisCommands; +import redis.clients.jedis.commands.JedisBinaryCommands; import redis.clients.jedis.commands.JedisCommands; -import redis.clients.jedis.commands.MultiKeyCommands; -import redis.clients.jedis.commands.RedisPipeline; -import redis.clients.jedis.commands.ScriptingCommands; +import redis.clients.jedis.params.ScanParams; +import redis.clients.jedis.resps.ScanResult; import redis.clients.jedis.util.Pool; public class JedisClientDelegate implements RedisClientDelegate { @@ -64,49 +61,49 @@ public void withCommandsClient(Consumer f) { } @Override - public R withMultiClient(Function f) { + public R withMultiClient(Function f) { try (Jedis jedis = jedisPool.getResource()) { return f.apply(jedis); } } @Override - public void withMultiClient(Consumer f) { + public void withMultiClient(Consumer f) { try (Jedis jedis = jedisPool.getResource()) { f.accept(jedis); } } @Override - public R withBinaryClient(Function f) { + public R withBinaryClient(Function f) { try (Jedis jedis = jedisPool.getResource()) { return f.apply(jedis); } } @Override - public void withBinaryClient(Consumer f) { + public void withBinaryClient(Consumer f) { try (Jedis jedis = jedisPool.getResource()) { f.accept(jedis); } } @Override - public void withPipeline(Consumer f) { + public void withPipeline(Consumer f) { try (Jedis jedis = jedisPool.getResource()) { f.accept(jedis.pipelined()); } } @Override - public R withPipeline(Function f) { + public R withPipeline(Function f) { try (Jedis jedis = jedisPool.getResource()) { return f.apply(jedis.pipelined()); } } @Override - public void syncPipeline(RedisPipeline p) { + public void syncPipeline(Pipeline p) { if (!(p instanceof Pipeline)) { throw new IllegalArgumentException( "Invalid RedisPipeline implementation: " + p.getClass().getName()); @@ -159,14 +156,14 @@ public boolean supportsScripting() { } @Override - public void withScriptingClient(Consumer f) { + public void withScriptingClient(Consumer f) { try (Jedis jedis = jedisPool.getResource()) { f.accept(jedis); } } @Override - public R withScriptingClient(Function f) { + public R withScriptingClient(Function f) { try (Jedis jedis = jedisPool.getResource()) { return f.apply(jedis); } diff --git a/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java b/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java index 0ff8ae562..c174073d5 100644 --- a/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java +++ b/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java @@ -19,11 +19,8 @@ import java.util.function.Function; import redis.clients.jedis.Pipeline; import redis.clients.jedis.Transaction; -import redis.clients.jedis.commands.BinaryJedisCommands; +import redis.clients.jedis.commands.JedisBinaryCommands; import redis.clients.jedis.commands.JedisCommands; -import redis.clients.jedis.commands.MultiKeyCommands; -import redis.clients.jedis.commands.RedisPipeline; -import redis.clients.jedis.commands.ScriptingCommands; /** * Offers a functional interface over either a vanilla Jedis or Dynomite client. @@ -38,19 +35,19 @@ public interface RedisClientDelegate { void withCommandsClient(Consumer f); - R withMultiClient(Function f); + R withMultiClient(Function f); - void withMultiClient(Consumer f); + void withMultiClient(Consumer f); - R withBinaryClient(Function f); + R withBinaryClient(Function f); - void withBinaryClient(Consumer f); + void withBinaryClient(Consumer f); - void withPipeline(Consumer f); + void withPipeline(Consumer f); - R withPipeline(Function f); + R withPipeline(Function f); - void syncPipeline(RedisPipeline p); + void syncPipeline(Pipeline p); boolean supportsMultiKeyPipelines(); @@ -66,9 +63,9 @@ public interface RedisClientDelegate { boolean supportsScripting(); - void withScriptingClient(Consumer f); + void withScriptingClient(Consumer f); - R withScriptingClient(Function f); + R withScriptingClient(Function f); void withKeyScan(String pattern, int count, Consumer f); } diff --git a/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java b/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java index 2da98e9f1..9e56ea36c 100644 --- a/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java +++ b/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java @@ -26,11 +26,23 @@ import java.util.Set; import java.util.concurrent.Callable; import redis.clients.jedis.*; +import redis.clients.jedis.args.BitOP; +import redis.clients.jedis.args.ClusterResetType; +import redis.clients.jedis.args.GeoUnit; +import redis.clients.jedis.args.ListPosition; +import redis.clients.jedis.exceptions.JedisException; +import redis.clients.jedis.params.BitPosParams; import redis.clients.jedis.params.GeoRadiusParam; +import redis.clients.jedis.params.ScanParams; import redis.clients.jedis.params.SetParams; +import redis.clients.jedis.params.SortingParams; import redis.clients.jedis.params.ZAddParams; import redis.clients.jedis.params.ZIncrByParams; -import redis.clients.jedis.util.Slowlog; +import redis.clients.jedis.params.ZParams; +import redis.clients.jedis.resps.GeoRadiusResponse; +import redis.clients.jedis.resps.ScanResult; +import redis.clients.jedis.resps.Slowlog; +import redis.clients.jedis.resps.Tuple; /** * Instruments: - Timer for each command - Distribution summary for all payload sizes - Error rates @@ -134,25 +146,25 @@ public String get(String key) { } @Override - public Long exists(String... keys) { + public long exists(String... keys) { String command = "exists"; return instrumented(command, () -> delegated.exists(keys)); } @Override - public Boolean exists(String key) { + public boolean exists(String key) { String command = "exists"; return instrumented(command, () -> delegated.exists(key)); } @Override - public Long del(String... keys) { + public long del(String... keys) { String command = "del"; return instrumented(command, () -> delegated.del(keys)); } @Override - public Long del(String key) { + public long del(String key) { String command = "del"; return instrumented(command, () -> delegated.del(key)); } @@ -182,31 +194,31 @@ public String rename(String oldkey, String newkey) { } @Override - public Long renamenx(String oldkey, String newkey) { + public long renamenx(String oldkey, String newkey) { String command = "renamenx"; return instrumented(command, () -> delegated.renamenx(oldkey, newkey)); } @Override - public Long expire(String key, int seconds) { + public long expire(String key, long seconds) { String command = "expire"; return instrumented(command, () -> delegated.expire(key, seconds)); } @Override - public Long expireAt(String key, long unixTime) { + public long expireAt(String key, long unixTime) { String command = "expireAt"; return instrumented(command, () -> delegated.expireAt(key, unixTime)); } @Override - public Long ttl(String key) { + public long ttl(String key) { String command = "ttl"; return instrumented(command, () -> delegated.ttl(key)); } @Override - public Long move(String key, int dbIndex) { + public long move(String key, int dbIndex) { String command = "move"; return instrumented(command, () -> delegated.move(key, dbIndex)); } @@ -224,13 +236,13 @@ public List mget(String... keys) { } @Override - public Long setnx(String key, String value) { + public long setnx(String key, String value) { String command = "setnx"; return instrumented(command, payloadSize(value), () -> delegated.setnx(key, value)); } @Override - public String setex(String key, int seconds, String value) { + public String setex(String key, long seconds, String value) { String command = "setex"; return instrumented(command, payloadSize(value), () -> delegated.setex(key, seconds, value)); } @@ -242,43 +254,43 @@ public String mset(String... keysvalues) { } @Override - public Long msetnx(String... keysvalues) { + public long msetnx(String... keysvalues) { String command = "msetnx"; return instrumented(command, payloadSize(keysvalues), () -> delegated.msetnx(keysvalues)); } @Override - public Long decrBy(String key, long integer) { + public long decrBy(String key, long integer) { String command = "decrBy"; return instrumented(command, () -> delegated.decrBy(key, integer)); } @Override - public Long decr(String key) { + public long decr(String key) { String command = "decr"; return instrumented(command, () -> delegated.decr(key)); } @Override - public Long incrBy(String key, long integer) { + public long incrBy(String key, long integer) { String command = "incrBy"; return instrumented(command, () -> delegated.incrBy(key, integer)); } @Override - public Double incrByFloat(String key, double value) { + public double incrByFloat(String key, double value) { String command = "incrByFloat"; return instrumented(command, () -> delegated.incrByFloat(key, value)); } @Override - public Long incr(String key) { + public long incr(String key) { String command = "incr"; return instrumented(command, () -> delegated.incr(key)); } @Override - public Long append(String key, String value) { + public long append(String key, String value) { String command = "append"; return instrumented(command, payloadSize(value), () -> delegated.append(key, value)); } @@ -290,7 +302,7 @@ public String substr(String key, int start, int end) { } @Override - public Long hset(String key, String field, String value) { + public long hset(String key, String field, String value) { String command = "hset"; return instrumented(command, payloadSize(value), () -> delegated.hset(key, field, value)); } @@ -302,7 +314,7 @@ public String hget(String key, String field) { } @Override - public Long hsetnx(String key, String field, String value) { + public long hsetnx(String key, String field, String value) { String command = "hsetnx"; return instrumented(command, payloadSize(value), () -> delegated.hsetnx(key, field, value)); } @@ -320,31 +332,31 @@ public List hmget(String key, String... fields) { } @Override - public Long hincrBy(String key, String field, long value) { + public long hincrBy(String key, String field, long value) { String command = "hincrBy"; return instrumented(command, () -> delegated.hincrBy(key, field, value)); } @Override - public Double hincrByFloat(String key, String field, double value) { + public double hincrByFloat(String key, String field, double value) { String command = "hincrByFloat"; return instrumented(command, () -> delegated.hincrByFloat(key, field, value)); } @Override - public Boolean hexists(String key, String field) { + public boolean hexists(String key, String field) { String command = "hexists"; return instrumented(command, () -> delegated.hexists(key, field)); } @Override - public Long hdel(String key, String... fields) { + public long hdel(String key, String... fields) { String command = "hdel"; return instrumented(command, () -> delegated.hdel(key, fields)); } @Override - public Long hlen(String key) { + public long hlen(String key) { String command = "hlen"; return instrumented(command, () -> delegated.hlen(key)); } @@ -368,19 +380,19 @@ public Map hgetAll(String key) { } @Override - public Long rpush(String key, String... strings) { + public long rpush(String key, String... strings) { String command = "rpush"; return instrumented(command, payloadSize(strings), () -> delegated.rpush(key, strings)); } @Override - public Long lpush(String key, String... strings) { + public long lpush(String key, String... strings) { String command = "lpush"; return instrumented(command, payloadSize(strings), () -> delegated.lpush(key, strings)); } @Override - public Long llen(String key) { + public long llen(String key) { String command = "llen"; return instrumented(command, () -> delegated.llen(key)); } @@ -410,7 +422,7 @@ public String lset(String key, long index, String value) { } @Override - public Long lrem(String key, long count, String value) { + public long lrem(String key, long count, String value) { String command = "lrem"; return instrumented(command, payloadSize(value), () -> delegated.lrem(key, count, value)); } @@ -434,7 +446,7 @@ public String rpoplpush(String srckey, String dstkey) { } @Override - public Long sadd(String key, String... members) { + public long sadd(String key, String... members) { String command = "sadd"; return instrumented(command, payloadSize(members), () -> delegated.sadd(key, members)); } @@ -446,7 +458,7 @@ public Set smembers(String key) { } @Override - public Long srem(String key, String... members) { + public long srem(String key, String... members) { String command = "srem"; return instrumented(command, payloadSize(members), () -> delegated.srem(key, members)); } @@ -464,19 +476,19 @@ public Set spop(String key, long count) { } @Override - public Long smove(String srckey, String dstkey, String member) { + public long smove(String srckey, String dstkey, String member) { String command = "smove"; return instrumented(command, () -> delegated.smove(srckey, dstkey, member)); } @Override - public Long scard(String key) { + public long scard(String key) { String command = "scard"; return instrumented(command, () -> delegated.scard(key)); } @Override - public Boolean sismember(String key, String member) { + public boolean sismember(String key, String member) { String command = "sismember"; return instrumented(command, () -> delegated.sismember(key, member)); } @@ -488,7 +500,7 @@ public Set sinter(String... keys) { } @Override - public Long sinterstore(String dstkey, String... keys) { + public long sinterstore(String dstkey, String... keys) { String command = "sinterstore"; return instrumented(command, () -> delegated.sinterstore(dstkey, keys)); } @@ -500,7 +512,7 @@ public Set sunion(String... keys) { } @Override - public Long sunionstore(String dstkey, String... keys) { + public long sunionstore(String dstkey, String... keys) { String command = "sunionstore"; return instrumented(command, () -> delegated.sunionstore(dstkey, keys)); } @@ -512,7 +524,7 @@ public Set sdiff(String... keys) { } @Override - public Long sdiffstore(String dstkey, String... keys) { + public long sdiffstore(String dstkey, String... keys) { String command = "sdiffstore"; return instrumented(command, () -> delegated.sdiffstore(dstkey, keys)); } @@ -530,43 +542,43 @@ public List srandmember(String key, int count) { } @Override - public Long zadd(String key, double score, String member) { + public long zadd(String key, double score, String member) { String command = "zadd"; return instrumented(command, () -> delegated.zadd(key, score, member)); } @Override - public Long zadd(String key, double score, String member, ZAddParams params) { + public long zadd(String key, double score, String member, ZAddParams params) { String command = "zadd"; return instrumented(command, () -> delegated.zadd(key, score, member, params)); } @Override - public Long zadd(String key, Map scoreMembers) { + public long zadd(String key, Map scoreMembers) { String command = "zadd"; return instrumented(command, () -> delegated.zadd(key, scoreMembers)); } @Override - public Long zadd(String key, Map scoreMembers, ZAddParams params) { + public long zadd(String key, Map scoreMembers, ZAddParams params) { String command = "zadd"; return instrumented(command, () -> delegated.zadd(key, scoreMembers, params)); } @Override - public Set zrange(String key, long start, long end) { + public List zrange(String key, long start, long end) { String command = "zrange"; return instrumented(command, () -> delegated.zrange(key, start, end)); } @Override - public Long zrem(String key, String... members) { + public long zrem(String key, String... members) { String command = "zrem"; return instrumented(command, () -> delegated.zrem(key, members)); } @Override - public Double zincrby(String key, double score, String member) { + public double zincrby(String key, double score, String member) { String command = "zincrby"; return instrumented(command, () -> delegated.zincrby(key, score, member)); } @@ -590,25 +602,25 @@ public Long zrevrank(String key, String member) { } @Override - public Set zrevrange(String key, long start, long end) { + public List zrevrange(String key, long start, long end) { String command = "zrevrange"; return instrumented(command, () -> delegated.zrevrange(key, start, end)); } @Override - public Set zrangeWithScores(String key, long start, long end) { + public List zrangeWithScores(String key, long start, long end) { String command = "zrangeWithScores"; return instrumented(command, () -> delegated.zrangeWithScores(key, start, end)); } @Override - public Set zrevrangeWithScores(String key, long start, long end) { + public List zrevrangeWithScores(String key, long start, long end) { String command = "zrevrangeWithScores"; return instrumented(command, () -> delegated.zrevrangeWithScores(key, start, end)); } @Override - public Long zcard(String key) { + public long zcard(String key) { String command = "zcard"; return instrumented(command, () -> delegated.zcard(key)); } @@ -644,25 +656,13 @@ public List blpop(int timeout, String... keys) { } @Override - public List blpop(String... args) { - String command = "blpop"; - return instrumented(command, () -> delegated.blpop(args)); - } - - @Override - public List brpop(String... args) { - String command = "brpop"; - return instrumented(command, () -> delegated.brpop(args)); - } - - @Override - public Long sort(String key, SortingParams sortingParameters, String dstkey) { + public long sort(String key, SortingParams sortingParameters, String dstkey) { String command = "sort"; return instrumented(command, () -> delegated.sort(key, sortingParameters, dstkey)); } @Override - public Long sort(String key, String dstkey) { + public long sort(String key, String dstkey) { String command = "sort"; return instrumented(command, () -> delegated.sort(key, dstkey)); } @@ -674,55 +674,55 @@ public List brpop(int timeout, String... keys) { } @Override - public Long zcount(String key, double min, double max) { + public long zcount(String key, double min, double max) { String command = "zcount"; return instrumented(command, () -> delegated.zcount(key, min, max)); } @Override - public Long zcount(String key, String min, String max) { + public long zcount(String key, String min, String max) { String command = "zcount"; return instrumented(command, () -> delegated.zcount(key, min, max)); } @Override - public Set zrangeByScore(String key, double min, double max) { + public List zrangeByScore(String key, double min, double max) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max)); } @Override - public Set zrangeByScore(String key, String min, String max) { + public List zrangeByScore(String key, String min, String max) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max)); } @Override - public Set zrangeByScore(String key, double min, double max, int offset, int count) { + public List zrangeByScore(String key, double min, double max, int offset, int count) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max, offset, count)); } @Override - public Set zrangeByScore(String key, String min, String max, int offset, int count) { + public List zrangeByScore(String key, String min, String max, int offset, int count) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max, offset, count)); } @Override - public Set zrangeByScoreWithScores(String key, double min, double max) { + public List zrangeByScoreWithScores(String key, double min, double max) { String command = "zrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrangeByScoreWithScores(key, min, max)); } @Override - public Set zrangeByScoreWithScores(String key, String min, String max) { + public List zrangeByScoreWithScores(String key, String min, String max) { String command = "zrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrangeByScoreWithScores(key, min, max)); } @Override - public Set zrangeByScoreWithScores( + public List zrangeByScoreWithScores( String key, double min, double max, int offset, int count) { String command = "zrangeByScoreWithScores"; return instrumented( @@ -730,7 +730,7 @@ public Set zrangeByScoreWithScores( } @Override - public Set zrangeByScoreWithScores( + public List zrangeByScoreWithScores( String key, String min, String max, int offset, int count) { String command = "zrangeByScoreWithScores"; return instrumented( @@ -738,31 +738,31 @@ public Set zrangeByScoreWithScores( } @Override - public Set zrevrangeByScore(String key, double max, double min) { + public List zrevrangeByScore(String key, double max, double min) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min)); } @Override - public Set zrevrangeByScore(String key, String max, String min) { + public List zrevrangeByScore(String key, String max, String min) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min)); } @Override - public Set zrevrangeByScore(String key, double max, double min, int offset, int count) { + public List zrevrangeByScore(String key, double max, double min, int offset, int count) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min, offset, count)); } @Override - public Set zrevrangeByScoreWithScores(String key, double max, double min) { + public List zrevrangeByScoreWithScores(String key, double max, double min) { String command = "zrevrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrevrangeByScoreWithScores(key, max, min)); } @Override - public Set zrevrangeByScoreWithScores( + public List zrevrangeByScoreWithScores( String key, double max, double min, int offset, int count) { String command = "zrevrangeByScoreWithScores"; return instrumented( @@ -770,7 +770,7 @@ public Set zrevrangeByScoreWithScores( } @Override - public Set zrevrangeByScoreWithScores( + public List zrevrangeByScoreWithScores( String key, String max, String min, int offset, int count) { String command = "zrevrangeByScoreWithScores"; return instrumented( @@ -778,115 +778,115 @@ public Set zrevrangeByScoreWithScores( } @Override - public Set zrevrangeByScore(String key, String max, String min, int offset, int count) { + public List zrevrangeByScore(String key, String max, String min, int offset, int count) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min, offset, count)); } @Override - public Set zrevrangeByScoreWithScores(String key, String max, String min) { + public List zrevrangeByScoreWithScores(String key, String max, String min) { String command = "zrevrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrevrangeByScoreWithScores(key, max, min)); } @Override - public Long zremrangeByRank(String key, long start, long end) { + public long zremrangeByRank(String key, long start, long end) { String command = "zremrangeByRank"; return instrumented(command, () -> delegated.zremrangeByRank(key, start, end)); } @Override - public Long zremrangeByScore(String key, double start, double end) { + public long zremrangeByScore(String key, double start, double end) { String command = "zremrangeByScore"; return instrumented(command, () -> delegated.zremrangeByScore(key, start, end)); } @Override - public Long zremrangeByScore(String key, String start, String end) { + public long zremrangeByScore(String key, String start, String end) { String command = "zremrangeByScore"; return instrumented(command, () -> delegated.zremrangeByScore(key, start, end)); } @Override - public Long zunionstore(String dstkey, String... sets) { + public long zunionstore(String dstkey, String... sets) { String command = "zunionstore"; return instrumented(command, () -> delegated.zunionstore(dstkey, sets)); } @Override - public Long zunionstore(String dstkey, ZParams params, String... sets) { + public long zunionstore(String dstkey, ZParams params, String... sets) { String command = "zunionstore"; return instrumented(command, () -> delegated.zunionstore(dstkey, params, sets)); } @Override - public Long zinterstore(String dstkey, String... sets) { + public long zinterstore(String dstkey, String... sets) { String command = "zinterstore"; return instrumented(command, () -> delegated.zinterstore(dstkey, sets)); } @Override - public Long zinterstore(String dstkey, ZParams params, String... sets) { + public long zinterstore(String dstkey, ZParams params, String... sets) { String command = "zinterstore"; return instrumented(command, () -> delegated.zinterstore(dstkey, params, sets)); } @Override - public Long zlexcount(String key, String min, String max) { + public long zlexcount(String key, String min, String max) { String command = "zlexcount"; return instrumented(command, () -> delegated.zlexcount(key, min, max)); } @Override - public Set zrangeByLex(String key, String min, String max) { + public List zrangeByLex(String key, String min, String max) { String command = "zrangeByLex"; return instrumented(command, () -> delegated.zrangeByLex(key, min, max)); } @Override - public Set zrangeByLex(String key, String min, String max, int offset, int count) { + public List zrangeByLex(String key, String min, String max, int offset, int count) { String command = "zrangeByLex"; return instrumented(command, () -> delegated.zrangeByLex(key, min, max, offset, count)); } @Override - public Set zrevrangeByLex(String key, String max, String min) { + public List zrevrangeByLex(String key, String max, String min) { String command = "zrevrangeByLex"; return instrumented(command, () -> delegated.zrevrangeByLex(key, max, min)); } @Override - public Set zrevrangeByLex(String key, String max, String min, int offset, int count) { + public List zrevrangeByLex(String key, String max, String min, int offset, int count) { String command = "zrevrangeByLex"; return instrumented(command, () -> delegated.zrevrangeByLex(key, max, min, offset, count)); } @Override - public Long zremrangeByLex(String key, String min, String max) { + public long zremrangeByLex(String key, String min, String max) { String command = "zremrangeByLex"; return instrumented(command, () -> delegated.zremrangeByLex(key, min, max)); } @Override - public Long strlen(String key) { + public long strlen(String key) { String command = "strlen"; return instrumented(command, () -> delegated.strlen(key)); } @Override - public Long lpushx(String key, String... string) { + public long lpushx(String key, String... string) { String command = "lpushx"; return instrumented(command, payloadSize(string), () -> delegated.lpushx(key, string)); } @Override - public Long persist(String key) { + public long persist(String key) { String command = "persist"; return instrumented(command, () -> delegated.persist(key)); } @Override - public Long rpushx(String key, String... string) { + public long rpushx(String key, String... string) { String command = "rpushx"; return instrumented(command, payloadSize(string), () -> delegated.rpushx(key, string)); } @@ -898,7 +898,7 @@ public String echo(String string) { } @Override - public Long linsert( + public long linsert( final String key, final ListPosition where, final String pivot, final String value) { String command = "linsert"; return instrumented( @@ -912,25 +912,19 @@ public String brpoplpush(String source, String destination, int timeout) { } @Override - public Boolean setbit(String key, long offset, boolean value) { + public boolean setbit(String key, long offset, boolean value) { String command = "setbit"; return instrumented(command, () -> delegated.setbit(key, offset, value)); } @Override - public Boolean setbit(String key, long offset, String value) { - String command = "setbit"; - return instrumented(command, payloadSize(value), () -> delegated.setbit(key, offset, value)); - } - - @Override - public Boolean getbit(String key, long offset) { + public boolean getbit(String key, long offset) { String command = "getbit"; return instrumented(command, () -> delegated.getbit(key, offset)); } @Override - public Long setrange(String key, long offset, String value) { + public long setrange(String key, long offset, String value) { String command = "setrange"; return instrumented(command, payloadSize(value), () -> delegated.setrange(key, offset, value)); } @@ -942,13 +936,13 @@ public String getrange(String key, long startOffset, long endOffset) { } @Override - public Long bitpos(String key, boolean value) { + public long bitpos(String key, boolean value) { String command = "bitpos"; return instrumented(command, () -> delegated.bitpos(key, value)); } @Override - public Long bitpos(String key, boolean value, BitPosParams params) { + public long bitpos(String key, boolean value, BitPosParams params) { String command = "bitpos"; return instrumented(command, () -> delegated.bitpos(key, value, params)); } @@ -980,7 +974,7 @@ public void subscribe(JedisPubSub jedisPubSub, String... channels) { } @Override - public Long publish(String channel, String message) { + public long publish(String channel, String message) { String command = "publish"; return instrumented(command, payloadSize(message), () -> delegated.publish(channel, message)); } @@ -1071,19 +1065,19 @@ public Long objectIdletime(String string) { } @Override - public Long bitcount(String key) { + public long bitcount(String key) { String command = "bitcount"; return instrumented(command, () -> delegated.bitcount(key)); } @Override - public Long bitcount(String key, long start, long end) { + public long bitcount(String key, long start, long end) { String command = "bitcount"; return instrumented(command, () -> delegated.bitcount(key, start, end)); } @Override - public Long bitop(BitOP op, String destKey, String... srcKeys) { + public long bitop(BitOP op, String destKey, String... srcKeys) { String command = "bitop"; return instrumented(command, () -> delegated.bitop(op, destKey, srcKeys)); } @@ -1143,25 +1137,25 @@ public byte[] dump(String key) { } @Override - public String restore(String key, int ttl, byte[] serializedValue) { + public String restore(String key, long ttl, byte[] serializedValue) { String command = "restore"; return instrumented(command, () -> delegated.restore(key, ttl, serializedValue)); } @Override - public Long pexpire(String key, long milliseconds) { + public long pexpire(String key, long milliseconds) { String command = "pexpire"; return instrumented(command, () -> delegated.pexpire(key, milliseconds)); } @Override - public Long pexpireAt(String key, long millisecondsTimestamp) { + public long pexpireAt(String key, long millisecondsTimestamp) { String command = "pexpireAt"; return instrumented(command, () -> delegated.pexpireAt(key, millisecondsTimestamp)); } @Override - public Long pttl(String key) { + public long pttl(String key) { String command = "pttl"; return instrumented(command, () -> delegated.pttl(key)); } @@ -1258,7 +1252,7 @@ public String clusterMeet(String ip, int port) { } @Override - public String clusterReset(final ClusterReset resetType) { + public String clusterReset(final ClusterResetType resetType) { String command = "clusterReset"; return instrumented(command, () -> delegated.clusterReset(resetType)); } @@ -1324,13 +1318,13 @@ public String clusterFlushSlots() { } @Override - public Long clusterKeySlot(String key) { + public long clusterKeySlot(String key) { String command = "clusterKeySlot"; return instrumented(command, () -> delegated.clusterKeySlot(key)); } @Override - public Long clusterCountKeysInSlot(int slot) { + public long clusterCountKeysInSlot(int slot) { String command = "clusterCountKeysInSlot"; return instrumented(command, () -> delegated.clusterCountKeysInSlot(slot)); } @@ -1384,7 +1378,7 @@ public Long pubsubNumPat() { } @Override - public Map pubsubNumSub(String... channels) { + public Map pubsubNumSub(String... channels) { String command = "pubsubNumSub"; return instrumented(command, () -> delegated.pubsubNumSub(channels)); } @@ -1396,12 +1390,7 @@ public void close() { } @Override - public void setDataSource(JedisPoolAbstract jedisPool) { - delegated.setDataSource(jedisPool); - } - - @Override - public Long pfadd(String key, String... elements) { + public long pfadd(String key, String... elements) { String command = "pfadd"; return instrumented(command, payloadSize(elements), () -> delegated.pfadd(key, elements)); } @@ -1437,14 +1426,14 @@ public List brpop(int timeout, String key) { } @Override - public Long geoadd(String key, double longitude, double latitude, String member) { + public long geoadd(String key, double longitude, double latitude, String member) { String command = "geoadd"; return instrumented( command, payloadSize(member), () -> delegated.geoadd(key, longitude, latitude, member)); } @Override - public Long geoadd(String key, Map memberCoordinateMap) { + public long geoadd(String key, Map memberCoordinateMap) { String command = "geoadd"; return instrumented(command, () -> delegated.geoadd(key, memberCoordinateMap)); } @@ -1545,25 +1534,25 @@ public String quit() { } @Override - public Long exists(byte[]... keys) { + public long exists(byte[]... keys) { String command = "exists"; return instrumented(command, () -> delegated.exists(keys)); } @Override - public Boolean exists(byte[] key) { + public boolean exists(byte[] key) { String command = "exists"; return instrumented(command, () -> delegated.exists(key)); } @Override - public Long del(byte[]... keys) { + public long del(byte[]... keys) { String command = "del"; return instrumented(command, () -> delegated.del(keys)); } @Override - public Long del(byte[] key) { + public long del(byte[] key) { String command = "del"; return instrumented(command, () -> delegated.del(key)); } @@ -1599,31 +1588,31 @@ public String rename(byte[] oldkey, byte[] newkey) { } @Override - public Long renamenx(byte[] oldkey, byte[] newkey) { + public long renamenx(byte[] oldkey, byte[] newkey) { String command = "renamenx"; return instrumented(command, () -> delegated.renamenx(oldkey, newkey)); } @Override - public Long dbSize() { + public long dbSize() { String command = "dbSize"; return instrumented(command, () -> delegated.dbSize()); } @Override - public Long expire(byte[] key, int seconds) { + public long expire(byte[] key, long seconds) { String command = "expire"; return instrumented(command, () -> delegated.expire(key, seconds)); } @Override - public Long expireAt(byte[] key, long unixTime) { + public long expireAt(byte[] key, long unixTime) { String command = "expireAt"; return instrumented(command, () -> delegated.expireAt(key, unixTime)); } @Override - public Long ttl(byte[] key) { + public long ttl(byte[] key) { String command = "ttl"; return instrumented(command, () -> delegated.ttl(key)); } @@ -1635,7 +1624,7 @@ public String select(int index) { } @Override - public Long move(byte[] key, int dbIndex) { + public long move(byte[] key, int dbIndex) { String command = "move"; return instrumented(command, () -> delegated.move(key, dbIndex)); } @@ -1659,13 +1648,13 @@ public List mget(byte[]... keys) { } @Override - public Long setnx(byte[] key, byte[] value) { + public long setnx(byte[] key, byte[] value) { String command = "setnx"; return instrumented(command, payloadSize(value), () -> delegated.setnx(key, value)); } @Override - public String setex(byte[] key, int seconds, byte[] value) { + public String setex(byte[] key, long seconds, byte[] value) { String command = "setex"; return instrumented(command, payloadSize(value), () -> delegated.setex(key, seconds, value)); } @@ -1677,43 +1666,43 @@ public String mset(byte[]... keysvalues) { } @Override - public Long msetnx(byte[]... keysvalues) { + public long msetnx(byte[]... keysvalues) { String command = "msetnx"; return instrumented(command, payloadSize(keysvalues), () -> delegated.msetnx(keysvalues)); } @Override - public Long decrBy(byte[] key, long integer) { + public long decrBy(byte[] key, long integer) { String command = "decrBy"; return instrumented(command, () -> delegated.decrBy(key, integer)); } @Override - public Long decr(byte[] key) { + public long decr(byte[] key) { String command = "decr"; return instrumented(command, () -> delegated.decr(key)); } @Override - public Long incrBy(byte[] key, long integer) { + public long incrBy(byte[] key, long integer) { String command = "incrBy"; return instrumented(command, () -> delegated.incrBy(key, integer)); } @Override - public Double incrByFloat(byte[] key, double integer) { + public double incrByFloat(byte[] key, double integer) { String command = "incrByFloat"; return instrumented(command, () -> delegated.incrByFloat(key, integer)); } @Override - public Long incr(byte[] key) { + public long incr(byte[] key) { String command = "incr"; return instrumented(command, () -> delegated.incr(key)); } @Override - public Long append(byte[] key, byte[] value) { + public long append(byte[] key, byte[] value) { String command = "append"; return instrumented(command, payloadSize(value), () -> delegated.append(key, value)); } @@ -1725,7 +1714,7 @@ public byte[] substr(byte[] key, int start, int end) { } @Override - public Long hset(byte[] key, byte[] field, byte[] value) { + public long hset(byte[] key, byte[] field, byte[] value) { String command = "hset"; return instrumented(command, payloadSize(value), () -> delegated.hset(key, field, value)); } @@ -1737,7 +1726,7 @@ public byte[] hget(byte[] key, byte[] field) { } @Override - public Long hsetnx(byte[] key, byte[] field, byte[] value) { + public long hsetnx(byte[] key, byte[] field, byte[] value) { String command = "hsetnx"; return instrumented(command, payloadSize(value), () -> delegated.hsetnx(key, field, value)); } @@ -1755,31 +1744,31 @@ public List hmget(byte[] key, byte[]... fields) { } @Override - public Long hincrBy(byte[] key, byte[] field, long value) { + public long hincrBy(byte[] key, byte[] field, long value) { String command = "hincrBy"; return instrumented(command, () -> delegated.hincrBy(key, field, value)); } @Override - public Double hincrByFloat(byte[] key, byte[] field, double value) { + public double hincrByFloat(byte[] key, byte[] field, double value) { String command = "hincrByFloat"; return instrumented(command, () -> delegated.hincrByFloat(key, field, value)); } @Override - public Boolean hexists(byte[] key, byte[] field) { + public boolean hexists(byte[] key, byte[] field) { String command = "hexists"; return instrumented(command, () -> delegated.hexists(key, field)); } @Override - public Long hdel(byte[] key, byte[]... fields) { + public long hdel(byte[] key, byte[]... fields) { String command = "hdel"; return instrumented(command, () -> delegated.hdel(key, fields)); } @Override - public Long hlen(byte[] key) { + public long hlen(byte[] key) { String command = "hlen"; return instrumented(command, () -> delegated.hlen(key)); } @@ -1803,19 +1792,19 @@ public Map hgetAll(byte[] key) { } @Override - public Long rpush(byte[] key, byte[]... strings) { + public long rpush(byte[] key, byte[]... strings) { String command = "rpush"; return instrumented(command, payloadSize(strings), () -> delegated.rpush(key, strings)); } @Override - public Long lpush(byte[] key, byte[]... strings) { + public long lpush(byte[] key, byte[]... strings) { String command = "lpush"; return instrumented(command, payloadSize(strings), () -> delegated.lpush(key, strings)); } @Override - public Long llen(byte[] key) { + public long llen(byte[] key) { String command = "llen"; return instrumented(command, () -> delegated.llen(key)); } @@ -1845,7 +1834,7 @@ public String lset(byte[] key, long index, byte[] value) { } @Override - public Long lrem(byte[] key, long count, byte[] value) { + public long lrem(byte[] key, long count, byte[] value) { String command = "lrem"; return instrumented(command, payloadSize(value), () -> delegated.lrem(key, count, value)); } @@ -1869,7 +1858,7 @@ public byte[] rpoplpush(byte[] srckey, byte[] dstkey) { } @Override - public Long sadd(byte[] key, byte[]... members) { + public long sadd(byte[] key, byte[]... members) { String command = "sadd"; return instrumented(command, payloadSize(members), () -> delegated.sadd(key, members)); } @@ -1881,7 +1870,7 @@ public Set smembers(byte[] key) { } @Override - public Long srem(byte[] key, byte[]... member) { + public long srem(byte[] key, byte[]... member) { String command = "srem"; return instrumented(command, payloadSize(member), () -> delegated.srem(key, member)); } @@ -1899,19 +1888,19 @@ public Set spop(byte[] key, long count) { } @Override - public Long smove(byte[] srckey, byte[] dstkey, byte[] member) { + public long smove(byte[] srckey, byte[] dstkey, byte[] member) { String command = "smove"; return instrumented(command, () -> delegated.smove(srckey, dstkey, member)); } @Override - public Long scard(byte[] key) { + public long scard(byte[] key) { String command = "scard"; return instrumented(command, () -> delegated.scard(key)); } @Override - public Boolean sismember(byte[] key, byte[] member) { + public boolean sismember(byte[] key, byte[] member) { String command = "sismember"; return instrumented(command, () -> delegated.sismember(key, member)); } @@ -1923,7 +1912,7 @@ public Set sinter(byte[]... keys) { } @Override - public Long sinterstore(byte[] dstkey, byte[]... keys) { + public long sinterstore(byte[] dstkey, byte[]... keys) { String command = "sinterstore"; return instrumented(command, () -> delegated.sinterstore(dstkey, keys)); } @@ -1935,7 +1924,7 @@ public Set sunion(byte[]... keys) { } @Override - public Long sunionstore(byte[] dstkey, byte[]... keys) { + public long sunionstore(byte[] dstkey, byte[]... keys) { String command = "sunionstore"; return instrumented(command, () -> delegated.sunionstore(dstkey, keys)); } @@ -1947,7 +1936,7 @@ public Set sdiff(byte[]... keys) { } @Override - public Long sdiffstore(byte[] dstkey, byte[]... keys) { + public long sdiffstore(byte[] dstkey, byte[]... keys) { String command = "sdiffstore"; return instrumented(command, () -> delegated.sdiffstore(dstkey, keys)); } @@ -1965,43 +1954,43 @@ public List srandmember(byte[] key, int count) { } @Override - public Long zadd(byte[] key, double score, byte[] member) { + public long zadd(byte[] key, double score, byte[] member) { String command = "zadd"; return instrumented(command, () -> delegated.zadd(key, score, member)); } @Override - public Long zadd(byte[] key, double score, byte[] member, ZAddParams params) { + public long zadd(byte[] key, double score, byte[] member, ZAddParams params) { String command = "zadd"; return instrumented(command, () -> delegated.zadd(key, score, member, params)); } @Override - public Long zadd(byte[] key, Map scoreMembers) { + public long zadd(byte[] key, Map scoreMembers) { String command = "zadd"; return instrumented(command, () -> delegated.zadd(key, scoreMembers)); } @Override - public Long zadd(byte[] key, Map scoreMembers, ZAddParams params) { + public long zadd(byte[] key, Map scoreMembers, ZAddParams params) { String command = "zadd"; return instrumented(command, () -> delegated.zadd(key, scoreMembers, params)); } @Override - public Set zrange(byte[] key, long start, long end) { + public List zrange(byte[] key, long start, long end) { String command = "zrange"; return instrumented(command, () -> delegated.zrange(key, start, end)); } @Override - public Long zrem(byte[] key, byte[]... members) { + public long zrem(byte[] key, byte[]... members) { String command = "zrem"; return instrumented(command, () -> delegated.zrem(key, members)); } @Override - public Double zincrby(byte[] key, double score, byte[] member) { + public double zincrby(byte[] key, double score, byte[] member) { String command = "zincrby"; return instrumented(command, () -> delegated.zincrby(key, score, member)); } @@ -2025,25 +2014,25 @@ public Long zrevrank(byte[] key, byte[] member) { } @Override - public Set zrevrange(byte[] key, long start, long end) { + public List zrevrange(byte[] key, long start, long end) { String command = "zrevrange"; return instrumented(command, () -> delegated.zrevrange(key, start, end)); } @Override - public Set zrangeWithScores(byte[] key, long start, long end) { + public List zrangeWithScores(byte[] key, long start, long end) { String command = "zrangeWithScores"; return instrumented(command, () -> delegated.zrangeWithScores(key, start, end)); } @Override - public Set zrevrangeWithScores(byte[] key, long start, long end) { + public List zrevrangeWithScores(byte[] key, long start, long end) { String command = "zrevrangeWithScores"; return instrumented(command, () -> delegated.zrevrangeWithScores(key, start, end)); } @Override - public Long zcard(byte[] key) { + public long zcard(byte[] key) { String command = "zcard"; return instrumented(command, () -> delegated.zcard(key)); } @@ -2106,13 +2095,13 @@ public List blpop(int timeout, byte[]... keys) { } @Override - public Long sort(byte[] key, SortingParams sortingParameters, byte[] dstkey) { + public long sort(byte[] key, SortingParams sortingParameters, byte[] dstkey) { String command = "sort"; return instrumented(command, () -> delegated.sort(key, sortingParameters, dstkey)); } @Override - public Long sort(byte[] key, byte[] dstkey) { + public long sort(byte[] key, byte[] dstkey) { String command = "sort"; return instrumented(command, () -> delegated.sort(key, dstkey)); } @@ -2124,15 +2113,15 @@ public List brpop(int timeout, byte[]... keys) { } @Override - public List blpop(byte[]... args) { + public List blpop(double timeout, byte[]... args) { String command = "blpop"; - return instrumented(command, () -> delegated.blpop(args)); + return instrumented(command, () -> delegated.blpop(timeout, args)); } @Override - public List brpop(byte[]... args) { + public List brpop(double timeout, byte[]... args) { String command = "brpop"; - return instrumented(command, () -> delegated.brpop(args)); + return instrumented(command, () -> delegated.brpop(timeout, args)); } @Override @@ -2144,60 +2133,59 @@ public String auth(String password) { @Override public Pipeline pipelined() { String command = "pipelined"; - return instrumented( - command, () -> new InstrumentedPipeline(registry, delegated.pipelined(), poolName)); + return instrumented(command, () -> new InstrumentedPipeline(registry, delegated, poolName)); } @Override - public Long zcount(byte[] key, double min, double max) { + public long zcount(byte[] key, double min, double max) { String command = "zcount"; return instrumented(command, () -> delegated.zcount(key, min, max)); } @Override - public Long zcount(byte[] key, byte[] min, byte[] max) { + public long zcount(byte[] key, byte[] min, byte[] max) { String command = "zcount"; return instrumented(command, () -> delegated.zcount(key, min, max)); } @Override - public Set zrangeByScore(byte[] key, double min, double max) { + public List zrangeByScore(byte[] key, double min, double max) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max)); } @Override - public Set zrangeByScore(byte[] key, byte[] min, byte[] max) { + public List zrangeByScore(byte[] key, byte[] min, byte[] max) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max)); } @Override - public Set zrangeByScore(byte[] key, double min, double max, int offset, int count) { + public List zrangeByScore(byte[] key, double min, double max, int offset, int count) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max, offset, count)); } @Override - public Set zrangeByScore(byte[] key, byte[] min, byte[] max, int offset, int count) { + public List zrangeByScore(byte[] key, byte[] min, byte[] max, int offset, int count) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max, offset, count)); } @Override - public Set zrangeByScoreWithScores(byte[] key, double min, double max) { + public List zrangeByScoreWithScores(byte[] key, double min, double max) { String command = "zrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrangeByScoreWithScores(key, min, max)); } @Override - public Set zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max) { + public List zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max) { String command = "zrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrangeByScoreWithScores(key, min, max)); } @Override - public Set zrangeByScoreWithScores( + public List zrangeByScoreWithScores( byte[] key, double min, double max, int offset, int count) { String command = "zrangeByScoreWithScores"; return instrumented( @@ -2205,7 +2193,7 @@ public Set zrangeByScoreWithScores( } @Override - public Set zrangeByScoreWithScores( + public List zrangeByScoreWithScores( byte[] key, byte[] min, byte[] max, int offset, int count) { String command = "zrangeByScoreWithScores"; return instrumented( @@ -2213,37 +2201,37 @@ public Set zrangeByScoreWithScores( } @Override - public Set zrevrangeByScore(byte[] key, double max, double min) { + public List zrevrangeByScore(byte[] key, double max, double min) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min)); } @Override - public Set zrevrangeByScore(byte[] key, byte[] max, byte[] min) { + public List zrevrangeByScore(byte[] key, byte[] max, byte[] min) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min)); } @Override - public Set zrevrangeByScore(byte[] key, double max, double min, int offset, int count) { + public List zrevrangeByScore(byte[] key, double max, double min, int offset, int count) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min, offset, count)); } @Override - public Set zrevrangeByScore(byte[] key, byte[] max, byte[] min, int offset, int count) { + public List zrevrangeByScore(byte[] key, byte[] max, byte[] min, int offset, int count) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min, offset, count)); } @Override - public Set zrevrangeByScoreWithScores(byte[] key, double max, double min) { + public List zrevrangeByScoreWithScores(byte[] key, double max, double min) { String command = "zrevrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrevrangeByScoreWithScores(key, max, min)); } @Override - public Set zrevrangeByScoreWithScores( + public List zrevrangeByScoreWithScores( byte[] key, double max, double min, int offset, int count) { String command = "zrevrangeByScoreWithScores"; return instrumented( @@ -2251,13 +2239,13 @@ public Set zrevrangeByScoreWithScores( } @Override - public Set zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min) { + public List zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min) { String command = "zrevrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrevrangeByScoreWithScores(key, max, min)); } @Override - public Set zrevrangeByScoreWithScores( + public List zrevrangeByScoreWithScores( byte[] key, byte[] max, byte[] min, int offset, int count) { String command = "zrevrangeByScoreWithScores"; return instrumented( @@ -2265,79 +2253,79 @@ public Set zrevrangeByScoreWithScores( } @Override - public Long zremrangeByRank(byte[] key, long start, long end) { + public long zremrangeByRank(byte[] key, long start, long end) { String command = "zremrangeByRank"; return instrumented(command, () -> delegated.zremrangeByRank(key, start, end)); } @Override - public Long zremrangeByScore(byte[] key, double start, double end) { + public long zremrangeByScore(byte[] key, double start, double end) { String command = "zremrangeByScore"; return instrumented(command, () -> delegated.zremrangeByScore(key, start, end)); } @Override - public Long zremrangeByScore(byte[] key, byte[] start, byte[] end) { + public long zremrangeByScore(byte[] key, byte[] start, byte[] end) { String command = "zremrangeByScore"; return instrumented(command, () -> delegated.zremrangeByScore(key, start, end)); } @Override - public Long zunionstore(byte[] dstkey, byte[]... sets) { + public long zunionstore(byte[] dstkey, byte[]... sets) { String command = "zunionstore"; return instrumented(command, () -> delegated.zunionstore(dstkey, sets)); } @Override - public Long zunionstore(byte[] dstkey, ZParams params, byte[]... sets) { + public long zunionstore(byte[] dstkey, ZParams params, byte[]... sets) { String command = "zunionstore"; return instrumented(command, () -> delegated.zunionstore(dstkey, params, sets)); } @Override - public Long zinterstore(byte[] dstkey, byte[]... sets) { + public long zinterstore(byte[] dstkey, byte[]... sets) { String command = "zinterstore"; return instrumented(command, () -> delegated.zinterstore(dstkey, sets)); } @Override - public Long zinterstore(byte[] dstkey, ZParams params, byte[]... sets) { + public long zinterstore(byte[] dstkey, ZParams params, byte[]... sets) { String command = "zinterstore"; return instrumented(command, () -> delegated.zinterstore(dstkey, params, sets)); } @Override - public Long zlexcount(byte[] key, byte[] min, byte[] max) { + public long zlexcount(byte[] key, byte[] min, byte[] max) { String command = "zlexcount"; return instrumented(command, () -> delegated.zlexcount(key, min, max)); } @Override - public Set zrangeByLex(byte[] key, byte[] min, byte[] max) { + public List zrangeByLex(byte[] key, byte[] min, byte[] max) { String command = "zrangeByLex"; return instrumented(command, () -> delegated.zrangeByLex(key, min, max)); } @Override - public Set zrangeByLex(byte[] key, byte[] min, byte[] max, int offset, int count) { + public List zrangeByLex(byte[] key, byte[] min, byte[] max, int offset, int count) { String command = "zrangeByLex"; return instrumented(command, () -> delegated.zrangeByLex(key, min, max, offset, count)); } @Override - public Set zrevrangeByLex(byte[] key, byte[] max, byte[] min) { + public List zrevrangeByLex(byte[] key, byte[] max, byte[] min) { String command = "zrevrangeByLex"; return instrumented(command, () -> delegated.zrevrangeByLex(key, max, min)); } @Override - public Set zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, int count) { + public List zrevrangeByLex(byte[] key, byte[] max, byte[] min, int offset, int count) { String command = "zrevrangeByLex"; return instrumented(command, () -> delegated.zrevrangeByLex(key, max, min, offset, count)); } @Override - public Long zremrangeByLex(byte[] key, byte[] min, byte[] max) { + public long zremrangeByLex(byte[] key, byte[] min, byte[] max) { String command = "zremrangeByLex"; return instrumented(command, () -> delegated.zremrangeByLex(key, min, max)); } @@ -2361,15 +2349,15 @@ public String bgrewriteaof() { } @Override - public Long lastsave() { + public long lastsave() { String command = "lastsave"; return instrumented(command, () -> delegated.lastsave()); } @Override - public String shutdown() { + public void shutdown() throws JedisException { String command = "shutdown"; - return instrumented(command, () -> delegated.shutdown()); + instrumented(command, () -> delegated.shutdown()); } @Override @@ -2414,7 +2402,7 @@ public String configResetStat() { } @Override - public byte[] configSet(byte[] parameter, byte[] value) { + public String configSet(byte[] parameter, byte[] value) { String command = "configSet"; return instrumented(command, () -> delegated.configSet(parameter, value)); } @@ -2426,30 +2414,25 @@ public boolean isConnected() { } @Override - public Long strlen(byte[] key) { + public long strlen(byte[] key) { String command = "strlen"; return instrumented(command, () -> delegated.strlen(key)); } @Override - public void sync() { - delegated.sync(); - } - - @Override - public Long lpushx(byte[] key, byte[]... string) { + public long lpushx(byte[] key, byte[]... string) { String command = "lpushx"; return instrumented(command, payloadSize(string), () -> delegated.lpushx(key, string)); } @Override - public Long persist(byte[] key) { + public long persist(byte[] key) { String command = "persist"; return instrumented(command, () -> delegated.persist(key)); } @Override - public Long rpushx(byte[] key, byte[]... string) { + public long rpushx(byte[] key, byte[]... string) { String command = "rpushx"; return instrumented(command, payloadSize(string), () -> delegated.rpushx(key, string)); } @@ -2461,7 +2444,7 @@ public byte[] echo(byte[] string) { } @Override - public Long linsert( + public long linsert( final byte[] key, final ListPosition where, final byte[] pivot, final byte[] value) { String command = "linsert"; return instrumented( @@ -2469,15 +2452,9 @@ public Long linsert( } @Override - public String debug(DebugParams params) { - String command = "debug"; - return instrumented(command, () -> delegated.debug(params)); - } - - @Override - public Client getClient() { + public Connection getClient() { String command = "getClient"; - return instrumented(command, () -> delegated.getClient()); + return instrumented(command, () -> delegated.getConnection()); } @Override @@ -2487,37 +2464,31 @@ public byte[] brpoplpush(byte[] source, byte[] destination, int timeout) { } @Override - public Boolean setbit(byte[] key, long offset, boolean value) { + public boolean setbit(byte[] key, long offset, boolean value) { String command = "setbit"; return instrumented(command, () -> delegated.setbit(key, offset, value)); } @Override - public Boolean setbit(byte[] key, long offset, byte[] value) { - String command = "setbit"; - return instrumented(command, payloadSize(value), () -> delegated.setbit(key, offset, value)); - } - - @Override - public Boolean getbit(byte[] key, long offset) { + public boolean getbit(byte[] key, long offset) { String command = "getbit"; return instrumented(command, () -> delegated.getbit(key, offset)); } @Override - public Long bitpos(byte[] key, boolean value) { + public long bitpos(byte[] key, boolean value) { String command = "bitpos"; return instrumented(command, () -> delegated.bitpos(key, value)); } @Override - public Long bitpos(byte[] key, boolean value, BitPosParams params) { + public long bitpos(byte[] key, boolean value, BitPosParams params) { String command = "bitpos"; return instrumented(command, () -> delegated.bitpos(key, value, params)); } @Override - public Long setrange(byte[] key, long offset, byte[] value) { + public long setrange(byte[] key, long offset, byte[] value) { String command = "setrange"; return instrumented(command, payloadSize(value), () -> delegated.setrange(key, offset, value)); } @@ -2529,7 +2500,7 @@ public byte[] getrange(byte[] key, long startOffset, long endOffset) { } @Override - public Long publish(byte[] channel, byte[] message) { + public long publish(byte[] channel, byte[] message) { String command = "publish"; return instrumented(command, payloadSize(message), () -> delegated.publish(channel, message)); } @@ -2557,15 +2528,6 @@ public Object eval(byte[] script, List keys, List args) { command, payloadSize(script) + payloadSize(args), () -> delegated.eval(script, keys, args)); } - @Override - public Object eval(byte[] script, byte[] keyCount, byte[]... params) { - String command = "eval"; - return instrumented( - command, - payloadSize(script) + payloadSize(params), - () -> delegated.eval(script, keyCount, params)); - } - @Override public Object eval(byte[] script, int keyCount, byte[]... params) { String command = "eval"; @@ -2607,13 +2569,13 @@ public String scriptFlush() { } @Override - public Long scriptExists(byte[] sha1) { + public Boolean scriptExists(byte[] sha1) { String command = "scriptExists"; return instrumented(command, () -> delegated.scriptExists(sha1)); } @Override - public List scriptExists(byte[]... sha1) { + public List scriptExists(byte[]... sha1) { String command = "scriptExists"; return instrumented(command, () -> delegated.scriptExists(sha1)); } @@ -2637,7 +2599,7 @@ public String slowlogReset() { } @Override - public Long slowlogLen() { + public long slowlogLen() { String command = "slowlogLen"; return instrumented(command, () -> delegated.slowlogLen()); } @@ -2673,19 +2635,19 @@ public Long objectIdletime(byte[] key) { } @Override - public Long bitcount(byte[] key) { + public long bitcount(byte[] key) { String command = "bitcount"; return instrumented(command, () -> delegated.bitcount(key)); } @Override - public Long bitcount(byte[] key, long start, long end) { + public long bitcount(byte[] key, long start, long end) { String command = "bitcount"; return instrumented(command, () -> delegated.bitcount(key, start, end)); } @Override - public Long bitop(BitOP op, byte[] destKey, byte[]... srcKeys) { + public long bitop(BitOP op, byte[] destKey, byte[]... srcKeys) { String command = "bitop"; return instrumented(command, () -> delegated.bitop(op, destKey, srcKeys)); } @@ -2697,25 +2659,25 @@ public byte[] dump(byte[] key) { } @Override - public String restore(byte[] key, int ttl, byte[] serializedValue) { + public String restore(byte[] key, long ttl, byte[] serializedValue) { String command = "restore"; return instrumented(command, () -> delegated.restore(key, ttl, serializedValue)); } @Override - public Long pexpire(byte[] key, long milliseconds) { + public long pexpire(byte[] key, long milliseconds) { String command = "pexpire"; return instrumented(command, () -> delegated.pexpire(key, milliseconds)); } @Override - public Long pexpireAt(byte[] key, long millisecondsTimestamp) { + public long pexpireAt(byte[] key, long millisecondsTimestamp) { String command = "pexpireAt"; return instrumented(command, () -> delegated.pexpireAt(key, millisecondsTimestamp)); } @Override - public Long pttl(byte[] key) { + public long pttl(byte[] key) { String command = "pttl"; return instrumented(command, () -> delegated.pttl(key)); } @@ -2758,13 +2720,13 @@ public List time() { } @Override - public Long waitReplicas(int replicas, long timeout) { + public long waitReplicas(int replicas, long timeout) { String command = "waitReplicas"; return instrumented(command, () -> delegated.waitReplicas(replicas, timeout)); } @Override - public Long pfadd(byte[] key, byte[]... elements) { + public long pfadd(byte[] key, byte[]... elements) { String command = "pfadd"; return instrumented(command, payloadSize(elements), () -> delegated.pfadd(key, elements)); } @@ -2782,7 +2744,7 @@ public String pfmerge(byte[] destkey, byte[]... sourcekeys) { } @Override - public Long pfcount(byte[]... keys) { + public long pfcount(byte[]... keys) { String command = "pfcount"; return instrumented(command, () -> delegated.pfcount(keys)); } @@ -2836,13 +2798,13 @@ public ScanResult zscan(byte[] key, byte[] cursor, ScanParams params) { } @Override - public Long geoadd(byte[] key, double longitude, double latitude, byte[] member) { + public long geoadd(byte[] key, double longitude, double latitude, byte[] member) { String command = "geoadd"; return instrumented(command, () -> delegated.geoadd(key, longitude, latitude, member)); } @Override - public Long geoadd(byte[] key, Map memberCoordinateMap) { + public long geoadd(byte[] key, Map memberCoordinateMap) { String command = "geoadd"; return instrumented(command, () -> delegated.geoadd(key, memberCoordinateMap)); } diff --git a/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedisPool.java b/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedisPool.java index 79e27bfb5..72b31c5f3 100644 --- a/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedisPool.java +++ b/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedisPool.java @@ -16,9 +16,6 @@ package com.netflix.spinnaker.kork.jedis.telemetry; import com.netflix.spectator.api.Registry; -import java.lang.reflect.Field; -import java.util.Objects; -import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.commons.pool2.impl.GenericObjectPool; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; @@ -29,8 +26,6 @@ public class InstrumentedJedisPool extends JedisPool { private final JedisPool delegated; private final String poolName; - private GenericObjectPool delegateInternalPool; - public InstrumentedJedisPool(Registry registry, JedisPool delegated) { this(registry, delegated, "unnamed"); } @@ -43,33 +38,25 @@ public InstrumentedJedisPool(Registry registry, JedisPool delegated, String pool @SuppressWarnings("unchecked") public GenericObjectPool getInternalPoolReference() { - if (delegateInternalPool == null) { - try { - Field f = FieldUtils.getField(delegated.getClass(), "internalPool", true); - if (Objects.isNull(f)) { - throw new IllegalStateException("Could not get reference to delegate's internal pool"); - } - delegateInternalPool = (GenericObjectPool) f.get(delegated); - } catch (IllegalAccessException e) { - throw new IllegalStateException("Could not get reference to delegate's internal pool", e); - } + if (delegated == null) { + throw new IllegalStateException("Could not get reference to delegate's internal pool"); } - return delegateInternalPool; + return delegated; } @Override public Jedis getResource() { - return new InstrumentedJedis(registry, delegated.getResource(), poolName); + return new InstrumentedJedis(registry, delegated.getResource(), poolName).unwrap(); } @Override - public void returnResourceObject(Jedis resource) { - super.returnResourceObject(unwrapResource(resource)); + public void returnResource(Jedis resource) { + super.returnResource(unwrapResource(resource)); } @Override - protected void returnBrokenResourceObject(Jedis resource) { - super.returnBrokenResourceObject(unwrapResource(resource)); + public void returnBrokenResource(Jedis resource) { + super.returnBrokenResource(unwrapResource(resource)); } @Override @@ -77,21 +64,11 @@ public void close() { delegated.close(); } - @Override - public boolean isClosed() { - return delegated.isClosed(); - } - @Override public void destroy() { delegated.destroy(); } - @Override - protected void closeInternalPool() { - // Explicitly not calling this; destroy and initPool are the only references to this method - } - @Override public int getNumActive() { return getInternalPoolReference().getNumActive(); @@ -107,16 +84,6 @@ public int getNumWaiters() { return getInternalPoolReference().getNumWaiters(); } - @Override - public long getMeanBorrowWaitTimeMillis() { - return getInternalPoolReference().getMeanBorrowWaitTimeMillis(); - } - - @Override - public long getMaxBorrowWaitTimeMillis() { - return getInternalPoolReference().getMaxBorrowWaitTimeMillis(); - } - @Override public void addObjects(int count) { delegated.addObjects(count); diff --git a/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java b/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java index 4fdcbb457..a451aa1d9 100644 --- a/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java +++ b/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java @@ -26,10 +26,17 @@ import java.util.Set; import java.util.concurrent.Callable; import redis.clients.jedis.*; +import redis.clients.jedis.args.BitOP; +import redis.clients.jedis.args.GeoUnit; +import redis.clients.jedis.params.BitPosParams; import redis.clients.jedis.params.GeoRadiusParam; import redis.clients.jedis.params.SetParams; +import redis.clients.jedis.params.SortingParams; import redis.clients.jedis.params.ZAddParams; import redis.clients.jedis.params.ZIncrByParams; +import redis.clients.jedis.params.ZParams; +import redis.clients.jedis.resps.GeoRadiusResponse; +import redis.clients.jedis.resps.Tuple; public class InstrumentedPipeline extends Pipeline { @@ -37,13 +44,14 @@ public class InstrumentedPipeline extends Pipeline { private final Pipeline delegated; private final String poolName; - public InstrumentedPipeline(Registry registry, Pipeline delegated) { - this(registry, delegated, "unnamed"); + public InstrumentedPipeline(Registry registry, Jedis jedis) { + this(registry, jedis, "unnamed"); } - public InstrumentedPipeline(Registry registry, Pipeline delegated, String poolName) { + public InstrumentedPipeline(Registry registry, Jedis jedis, String poolName) { + super(jedis); this.registry = registry; - this.delegated = delegated; + this.delegated = jedis.pipelined(); this.poolName = poolName; } @@ -103,22 +111,6 @@ registry, payloadSizeId(registry, poolName, command, true)) } } - @Override - public void setClient(Client client) { - delegated.setClient(client); - } - - @Override - public void clear() { - delegated.clear(); - } - - @Override - public boolean isInMulti() { - String command = "isInMulti"; - return instrumented(command, () -> delegated.isInMulti()); - } - @Override public void sync() { delegated.sync(); @@ -127,25 +119,7 @@ public void sync() { @Override public List syncAndReturnAll() { String command = "syncAndReturnAll"; - return instrumented(command, () -> delegated.syncAndReturnAll()); - } - - @Override - public Response discard() { - String command = "discard"; - return instrumented(command, () -> delegated.discard()); - } - - @Override - public Response> exec() { - String command = "exec"; - return instrumented(command, () -> delegated.exec()); - } - - @Override - public Response multi() { - String command = "multi"; - return instrumented(command, () -> delegated.multi()); + return instrumented(command, delegated::syncAndReturnAll); } @Override @@ -154,24 +128,12 @@ public void close() { delegated.close(); } - @Override - public Response> brpop(String... args) { - String command = "brpop"; - return instrumented(command, () -> delegated.brpop(args)); - } - @Override public Response> brpop(int timeout, String... keys) { String command = "brpop"; return instrumented(command, () -> delegated.brpop(timeout, keys)); } - @Override - public Response> blpop(String... args) { - String command = "blpop"; - return instrumented(command, () -> delegated.blpop(args)); - } - @Override public Response> blpop(int timeout, String... keys) { String command = "blpop"; @@ -179,37 +141,25 @@ public Response> blpop(int timeout, String... keys) { } @Override - public Response> blpopMap(int timeout, String... keys) { - String command = "blpopMap"; - return instrumented(command, () -> delegated.blpopMap(timeout, keys)); - } - - @Override - public Response> brpop(byte[]... args) { + public Response> brpop(double timeout, byte[]... args) { String command = "brpop"; - return instrumented(command, () -> delegated.brpop(args)); + return instrumented(command, () -> delegated.brpop(timeout, args)); } @Override - public Response> brpop(int timeout, byte[]... keys) { + public Response> brpop(int timeout, byte[]... keys) { String command = "brpop"; return instrumented(command, () -> delegated.brpop(timeout, keys)); } @Override - public Response> brpopMap(int timeout, String... keys) { - String command = "brpopMap"; - return instrumented(command, () -> delegated.brpopMap(timeout, keys)); - } - - @Override - public Response> blpop(byte[]... args) { + public Response> blpop(double timeout, byte[]... args) { String command = "blpop"; - return instrumented(command, () -> delegated.blpop(args)); + return instrumented(command, () -> delegated.blpop(timeout, args)); } @Override - public Response> blpop(int timeout, byte[]... keys) { + public Response> blpop(int timeout, byte[]... keys) { String command = "blpop"; return instrumented(command, () -> delegated.blpop(timeout, keys)); } @@ -430,18 +380,6 @@ public Response sunionstore(byte[] dstkey, byte[]... keys) { return instrumented(command, () -> delegated.sunionstore(dstkey, keys)); } - @Override - public Response watch(String... keys) { - String command = "watch"; - return instrumented(command, () -> delegated.watch(keys)); - } - - @Override - public Response watch(byte[]... keys) { - String command = "watch"; - return instrumented(command, () -> delegated.watch(keys)); - } - @Override public Response zinterstore(String dstkey, String... sets) { String command = "zinterstore"; @@ -490,30 +428,6 @@ public Response zunionstore(byte[] dstkey, ZParams params, byte[]... sets) return instrumented(command, () -> delegated.zunionstore(dstkey, params, sets)); } - @Override - public Response bgrewriteaof() { - String command = "bgrewriteaof"; - return instrumented(command, () -> delegated.bgrewriteaof()); - } - - @Override - public Response bgsave() { - String command = "bgsave"; - return instrumented(command, () -> delegated.bgsave()); - } - - @Override - public Response> configGet(String pattern) { - String command = "configGet"; - return instrumented(command, () -> delegated.configGet(pattern)); - } - - @Override - public Response configSet(String parameter, String value) { - String command = "configSet"; - return instrumented(command, () -> delegated.configSet(parameter, value)); - } - @Override public Response brpoplpush(String source, String destination, int timeout) { String command = "brpoplpush"; @@ -526,24 +440,6 @@ public Response brpoplpush(byte[] source, byte[] destination, int timeou return instrumented(command, () -> delegated.brpoplpush(source, destination, timeout)); } - @Override - public Response configResetStat() { - String command = "configResetStat"; - return instrumented(command, () -> delegated.configResetStat()); - } - - @Override - public Response save() { - String command = "save"; - return instrumented(command, () -> delegated.save()); - } - - @Override - public Response lastsave() { - String command = "lastsave"; - return instrumented(command, () -> delegated.lastsave()); - } - @Override public Response publish(String channel, String message) { String command = "publish"; @@ -559,61 +455,19 @@ public Response publish(byte[] channel, byte[] message) { @Override public Response randomKey() { String command = "randomKey"; - return instrumented(command, () -> delegated.randomKey()); - } - - @Override - public Response randomKeyBinary() { - String command = "randomKeyBinary"; - return instrumented(command, () -> delegated.randomKeyBinary()); - } - - @Override - public Response flushDB() { - String command = "flushDB"; - return instrumented(command, () -> delegated.flushDB()); - } - - @Override - public Response flushAll() { - String command = "flushAll"; - return instrumented(command, () -> delegated.flushAll()); - } - - @Override - public Response info() { - String command = "info"; - return instrumented(command, () -> delegated.info()); - } - - @Override - public Response info(String section) { - String command = "info"; - return instrumented(command, () -> delegated.info(section)); + return instrumented(command, delegated::randomKey); } @Override public Response> time() { String command = "time"; - return instrumented(command, () -> delegated.time()); + return instrumented(command, delegated::time); } @Override public Response dbSize() { String command = "dbSize"; - return instrumented(command, () -> delegated.dbSize()); - } - - @Override - public Response shutdown() { - String command = "shutdown"; - return instrumented(command, () -> delegated.shutdown()); - } - - @Override - public Response ping() { - String command = "ping"; - return instrumented(command, () -> delegated.ping()); + return instrumented(command, delegated::dbSize); } @Override @@ -634,75 +488,12 @@ public Response bitop(BitOP op, String destKey, String... srcKeys) { return instrumented(command, () -> delegated.bitop(op, destKey, srcKeys)); } - @Override - public Response clusterNodes() { - String command = "clusterNodes"; - return instrumented(command, () -> delegated.clusterNodes()); - } - - @Override - public Response clusterMeet(String ip, int port) { - String command = "clusterMeet"; - return instrumented(command, () -> delegated.clusterMeet(ip, port)); - } - - @Override - public Response clusterAddSlots(int... slots) { - String command = "clusterAddSlots"; - return instrumented(command, () -> delegated.clusterAddSlots(slots)); - } - - @Override - public Response clusterDelSlots(int... slots) { - String command = "clusterDelSlots"; - return instrumented(command, () -> delegated.clusterDelSlots(slots)); - } - - @Override - public Response clusterInfo() { - String command = "clusterInfo"; - return instrumented(command, () -> delegated.clusterInfo()); - } - - @Override - public Response> clusterGetKeysInSlot(int slot, int count) { - String command = "clusterGetKeysInSlot"; - return instrumented(command, () -> delegated.clusterGetKeysInSlot(slot, count)); - } - - @Override - public Response clusterSetSlotNode(int slot, String nodeId) { - String command = "clusterSetSlotNode"; - return instrumented(command, () -> delegated.clusterSetSlotNode(slot, nodeId)); - } - - @Override - public Response clusterSetSlotMigrating(int slot, String nodeId) { - String command = "clusterSetSlotMigrating"; - return instrumented(command, () -> delegated.clusterSetSlotMigrating(slot, nodeId)); - } - - @Override - public Response clusterSetSlotImporting(int slot, String nodeId) { - String command = "clusterSetSlotImporting"; - return instrumented(command, () -> delegated.clusterSetSlotImporting(slot, nodeId)); - } - @Override public Response eval(byte[] script) { String command = "eval"; return instrumented(command, payloadSize(script), () -> delegated.eval(script)); } - @Override - public Response eval(byte[] script, byte[] keyCount, byte[]... params) { - String command = "eval"; - return instrumented( - command, - payloadSize(script) + payloadSize(params), - () -> delegated.eval(script, keyCount, params)); - } - @Override public Response eval(byte[] script, List keys, List args) { String command = "eval"; @@ -774,36 +565,6 @@ public Response append(byte[] key, byte[] value) { return instrumented(command, payloadSize(value), () -> delegated.append(key, value)); } - @Override - public Response> blpop(String key) { - String command = "blpop"; - return instrumented(command, () -> delegated.blpop(key)); - } - - @Override - public Response> brpop(String key) { - String command = "brpop"; - return instrumented(command, () -> delegated.brpop(key)); - } - - @Override - public Response> blpop(byte[] key) { - String command = "blpop"; - return instrumented(command, () -> delegated.blpop(key)); - } - - @Override - public Response> brpop(byte[] key) { - String command = "brpop"; - return instrumented(command, () -> delegated.brpop(key)); - } - - @Override - public Response decr(String key) { - String command = "decr"; - return instrumented(command, () -> delegated.decr(key)); - } - @Override public Response decr(byte[] key) { String command = "decr"; @@ -834,18 +595,6 @@ public Response del(byte[] key) { return instrumented(command, () -> delegated.del(key)); } - @Override - public Response echo(String string) { - String command = "echo"; - return instrumented(command, () -> delegated.echo(string)); - } - - @Override - public Response echo(byte[] string) { - String command = "echo"; - return instrumented(command, () -> delegated.echo(string)); - } - @Override public Response exists(String key) { String command = "exists"; @@ -859,13 +608,13 @@ public Response exists(byte[] key) { } @Override - public Response expire(String key, int seconds) { + public Response expire(String key, long seconds) { String command = "expire"; return instrumented(command, () -> delegated.expire(key, seconds)); } @Override - public Response expire(byte[] key, int seconds) { + public Response expire(byte[] key, long seconds) { String command = "expire"; return instrumented(command, () -> delegated.expire(key, seconds)); } @@ -1333,19 +1082,19 @@ public Response setbit(String key, long offset, boolean value) { } @Override - public Response setbit(byte[] key, long offset, byte[] value) { + public Response setbit(byte[] key, long offset, boolean value) { String command = "setbit"; return instrumented(command, () -> delegated.setbit(key, offset, value)); } @Override - public Response setex(String key, int seconds, String value) { + public Response setex(String key, long seconds, String value) { String command = "setex"; return instrumented(command, payloadSize(value), () -> delegated.setex(key, seconds, value)); } @Override - public Response setex(byte[] key, int seconds, byte[] value) { + public Response setex(byte[] key, long seconds, byte[] value) { String command = "setex"; return instrumented(command, payloadSize(value), () -> delegated.setex(key, seconds, value)); } @@ -1501,7 +1250,7 @@ public Response substr(String key, int start, int end) { } @Override - public Response substr(byte[] key, int start, int end) { + public Response substr(byte[] key, int start, int end) { String command = "substr"; return instrumented(command, () -> delegated.substr(key, start, end)); } @@ -1641,95 +1390,95 @@ public Response zincrby(byte[] key, double score, byte[] member, ZIncrBy } @Override - public Response> zrange(String key, long start, long end) { + public Response> zrange(String key, long start, long end) { String command = "zrange"; return instrumented(command, () -> delegated.zrange(key, start, end)); } @Override - public Response> zrange(byte[] key, long start, long end) { + public Response> zrange(byte[] key, long start, long end) { String command = "zrange"; return instrumented(command, () -> delegated.zrange(key, start, end)); } @Override - public Response> zrangeByScore(String key, double min, double max) { + public Response> zrangeByScore(String key, double min, double max) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max)); } @Override - public Response> zrangeByScore(byte[] key, double min, double max) { + public Response> zrangeByScore(byte[] key, double min, double max) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max)); } @Override - public Response> zrangeByScore(String key, String min, String max) { + public Response> zrangeByScore(String key, String min, String max) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max)); } @Override - public Response> zrangeByScore(byte[] key, byte[] min, byte[] max) { + public Response> zrangeByScore(byte[] key, byte[] min, byte[] max) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max)); } @Override - public Response> zrangeByScore( + public Response> zrangeByScore( String key, double min, double max, int offset, int count) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max, offset, count)); } @Override - public Response> zrangeByScore( + public Response> zrangeByScore( String key, String min, String max, int offset, int count) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max, offset, count)); } @Override - public Response> zrangeByScore( + public Response> zrangeByScore( byte[] key, double min, double max, int offset, int count) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max, offset, count)); } @Override - public Response> zrangeByScore( + public Response> zrangeByScore( byte[] key, byte[] min, byte[] max, int offset, int count) { String command = "zrangeByScore"; return instrumented(command, () -> delegated.zrangeByScore(key, min, max, offset, count)); } @Override - public Response> zrangeByScoreWithScores(String key, double min, double max) { + public Response> zrangeByScoreWithScores(String key, double min, double max) { String command = "zrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrangeByScoreWithScores(key, min, max)); } @Override - public Response> zrangeByScoreWithScores(String key, String min, String max) { + public Response> zrangeByScoreWithScores(String key, String min, String max) { String command = "zrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrangeByScoreWithScores(key, min, max)); } @Override - public Response> zrangeByScoreWithScores(byte[] key, double min, double max) { + public Response> zrangeByScoreWithScores(byte[] key, double min, double max) { String command = "zrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrangeByScoreWithScores(key, min, max)); } @Override - public Response> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max) { + public Response> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max) { String command = "zrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrangeByScoreWithScores(key, min, max)); } @Override - public Response> zrangeByScoreWithScores( + public Response> zrangeByScoreWithScores( String key, double min, double max, int offset, int count) { String command = "zrangeByScoreWithScores"; return instrumented( @@ -1737,7 +1486,7 @@ public Response> zrangeByScoreWithScores( } @Override - public Response> zrangeByScoreWithScores( + public Response> zrangeByScoreWithScores( String key, String min, String max, int offset, int count) { String command = "zrangeByScoreWithScores"; return instrumented( @@ -1745,7 +1494,7 @@ public Response> zrangeByScoreWithScores( } @Override - public Response> zrangeByScoreWithScores( + public Response> zrangeByScoreWithScores( byte[] key, double min, double max, int offset, int count) { String command = "zrangeByScoreWithScores"; return instrumented( @@ -1753,7 +1502,7 @@ public Response> zrangeByScoreWithScores( } @Override - public Response> zrangeByScoreWithScores( + public Response> zrangeByScoreWithScores( byte[] key, byte[] min, byte[] max, int offset, int count) { String command = "zrangeByScoreWithScores"; return instrumented( @@ -1761,83 +1510,83 @@ public Response> zrangeByScoreWithScores( } @Override - public Response> zrevrangeByScore(String key, double max, double min) { + public Response> zrevrangeByScore(String key, double max, double min) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min)); } @Override - public Response> zrevrangeByScore(byte[] key, double max, double min) { + public Response> zrevrangeByScore(byte[] key, double max, double min) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min)); } @Override - public Response> zrevrangeByScore(String key, String max, String min) { + public Response> zrevrangeByScore(String key, String max, String min) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min)); } @Override - public Response> zrevrangeByScore(byte[] key, byte[] max, byte[] min) { + public Response> zrevrangeByScore(byte[] key, byte[] max, byte[] min) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min)); } @Override - public Response> zrevrangeByScore( + public Response> zrevrangeByScore( String key, double max, double min, int offset, int count) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min, offset, count)); } @Override - public Response> zrevrangeByScore( + public Response> zrevrangeByScore( String key, String max, String min, int offset, int count) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min, offset, count)); } @Override - public Response> zrevrangeByScore( + public Response> zrevrangeByScore( byte[] key, double max, double min, int offset, int count) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min, offset, count)); } @Override - public Response> zrevrangeByScore( + public Response> zrevrangeByScore( byte[] key, byte[] max, byte[] min, int offset, int count) { String command = "zrevrangeByScore"; return instrumented(command, () -> delegated.zrevrangeByScore(key, max, min, offset, count)); } @Override - public Response> zrevrangeByScoreWithScores(String key, double max, double min) { + public Response> zrevrangeByScoreWithScores(String key, double max, double min) { String command = "zrevrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrevrangeByScoreWithScores(key, max, min)); } @Override - public Response> zrevrangeByScoreWithScores(String key, String max, String min) { + public Response> zrevrangeByScoreWithScores(String key, String max, String min) { String command = "zrevrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrevrangeByScoreWithScores(key, max, min)); } @Override - public Response> zrevrangeByScoreWithScores(byte[] key, double max, double min) { + public Response> zrevrangeByScoreWithScores(byte[] key, double max, double min) { String command = "zrevrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrevrangeByScoreWithScores(key, max, min)); } @Override - public Response> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min) { + public Response> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min) { String command = "zrevrangeByScoreWithScores"; return instrumented(command, () -> delegated.zrevrangeByScoreWithScores(key, max, min)); } @Override - public Response> zrevrangeByScoreWithScores( + public Response> zrevrangeByScoreWithScores( String key, double max, double min, int offset, int count) { String command = "zrevrangeByScoreWithScores"; return instrumented( @@ -1845,7 +1594,7 @@ public Response> zrevrangeByScoreWithScores( } @Override - public Response> zrevrangeByScoreWithScores( + public Response> zrevrangeByScoreWithScores( String key, String max, String min, int offset, int count) { String command = "zrevrangeByScoreWithScores"; return instrumented( @@ -1853,7 +1602,7 @@ public Response> zrevrangeByScoreWithScores( } @Override - public Response> zrevrangeByScoreWithScores( + public Response> zrevrangeByScoreWithScores( byte[] key, double max, double min, int offset, int count) { String command = "zrevrangeByScoreWithScores"; return instrumented( @@ -1861,7 +1610,7 @@ public Response> zrevrangeByScoreWithScores( } @Override - public Response> zrevrangeByScoreWithScores( + public Response> zrevrangeByScoreWithScores( byte[] key, byte[] max, byte[] min, int offset, int count) { String command = "zrevrangeByScoreWithScores"; return instrumented( @@ -1869,13 +1618,13 @@ public Response> zrevrangeByScoreWithScores( } @Override - public Response> zrangeWithScores(String key, long start, long end) { + public Response> zrangeWithScores(String key, long start, long end) { String command = "zrangeWithScores"; return instrumented(command, () -> delegated.zrangeWithScores(key, start, end)); } @Override - public Response> zrangeWithScores(byte[] key, long start, long end) { + public Response> zrangeWithScores(byte[] key, long start, long end) { String command = "zrangeWithScores"; return instrumented(command, () -> delegated.zrangeWithScores(key, start, end)); } @@ -1941,25 +1690,25 @@ public Response zremrangeByScore(byte[] key, byte[] start, byte[] end) { } @Override - public Response> zrevrange(String key, long start, long end) { + public Response> zrevrange(String key, long start, long end) { String command = "zrevrange"; return instrumented(command, () -> delegated.zrevrange(key, start, end)); } @Override - public Response> zrevrange(byte[] key, long start, long end) { + public Response> zrevrange(byte[] key, long start, long end) { String command = "zrevrange"; return instrumented(command, () -> delegated.zrevrange(key, start, end)); } @Override - public Response> zrevrangeWithScores(String key, long start, long end) { + public Response> zrevrangeWithScores(String key, long start, long end) { String command = "zrevrangeWithScores"; return instrumented(command, () -> delegated.zrevrangeWithScores(key, start, end)); } @Override - public Response> zrevrangeWithScores(byte[] key, long start, long end) { + public Response> zrevrangeWithScores(byte[] key, long start, long end) { String command = "zrevrangeWithScores"; return instrumented(command, () -> delegated.zrevrangeWithScores(key, start, end)); } @@ -2001,52 +1750,52 @@ public Response zlexcount(String key, String min, String max) { } @Override - public Response> zrangeByLex(byte[] key, byte[] min, byte[] max) { + public Response> zrangeByLex(byte[] key, byte[] min, byte[] max) { String command = "zrangeByLex"; return instrumented(command, () -> delegated.zrangeByLex(key, min, max)); } @Override - public Response> zrangeByLex(String key, String min, String max) { + public Response> zrangeByLex(String key, String min, String max) { String command = "zrangeByLex"; return instrumented(command, () -> delegated.zrangeByLex(key, min, max)); } @Override - public Response> zrangeByLex( + public Response> zrangeByLex( byte[] key, byte[] min, byte[] max, int offset, int count) { String command = "zrangeByLex"; return instrumented(command, () -> delegated.zrangeByLex(key, min, max, offset, count)); } @Override - public Response> zrangeByLex( + public Response> zrangeByLex( String key, String min, String max, int offset, int count) { String command = "zrangeByLex"; return instrumented(command, () -> delegated.zrangeByLex(key, min, max, offset, count)); } @Override - public Response> zrevrangeByLex(byte[] key, byte[] max, byte[] min) { + public Response> zrevrangeByLex(byte[] key, byte[] max, byte[] min) { String command = "zrevrangeByLex"; return instrumented(command, () -> delegated.zrevrangeByLex(key, max, min)); } @Override - public Response> zrevrangeByLex(String key, String max, String min) { + public Response> zrevrangeByLex(String key, String max, String min) { String command = "zrevrangeByLex"; return instrumented(command, () -> delegated.zrevrangeByLex(key, max, min)); } @Override - public Response> zrevrangeByLex( + public Response> zrevrangeByLex( byte[] key, byte[] max, byte[] min, int offset, int count) { String command = "zrevrangeByLex"; return instrumented(command, () -> delegated.zrevrangeByLex(key, max, min, offset, count)); } @Override - public Response> zrevrangeByLex( + public Response> zrevrangeByLex( String key, String max, String min, int offset, int count) { String command = "zrevrangeByLex"; return instrumented(command, () -> delegated.zrevrangeByLex(key, max, min, offset, count)); @@ -2187,13 +1936,13 @@ public Response pttl(byte[] key) { } @Override - public Response restore(String key, int ttl, byte[] serializedValue) { + public Response restore(String key, long ttl, byte[] serializedValue) { String command = "restore"; return instrumented(command, () -> delegated.restore(key, ttl, serializedValue)); } @Override - public Response restore(byte[] key, int ttl, byte[] serializedValue) { + public Response restore(byte[] key, long ttl, byte[] serializedValue) { String command = "restore"; return instrumented(command, () -> delegated.restore(key, ttl, serializedValue)); } diff --git a/spinnaker-dependencies/spinnaker-dependencies.gradle b/spinnaker-dependencies/spinnaker-dependencies.gradle index eb07ea00d..59be10f5c 100644 --- a/spinnaker-dependencies/spinnaker-dependencies.gradle +++ b/spinnaker-dependencies/spinnaker-dependencies.gradle @@ -20,16 +20,14 @@ ext { // 1.4.14. See https://logback.qos.ch/news.html#1.3.12. logback : "1.2.13", protobuf : "3.25.2", - okhttp3 : "4.9.3", openapi : "1.8.0", - restassured : "5.2.1", // spring boot 2.7.18 brings rest-assured 4.5.1. It uses groovy 3. Keep until spring boot >=3.0.13 retrofit : "1.9.0", retrofit2 : "2.8.1", spectator : "1.0.6", spek : "1.1.5", spek2 : "2.0.9", - springBoot : "2.7.18", - springCloud : "2021.0.8", + springBoot : "3.0.13", + springCloud : "2022.0.5", swagger : "2.2.22", // 2.7.18 brings in 9.0.83, which fixes all CVEs to date (20-feb-24). Continue to pin. // See https://tomcat.apache.org/security-9.html for latest security fixes. @@ -82,18 +80,6 @@ dependencies { api("ch.qos.logback:logback-access:${versions.logback}") { force = true } - api("io.rest-assured:xml-path:${versions.restassured}") { - force = true - } - api("io.rest-assured:json-path:${versions.restassured}") { - force = true - } - api("io.rest-assured:rest-assured:${versions.restassured}") { - force = true - } - api("io.rest-assured:rest-assured-common:${versions.restassured}") { - force = true - } api("com.amazonaws:aws-java-sdk:${versions.aws}") api("com.google.api-client:google-api-client:2.4.1") api("com.google.apis:google-api-services-admin-directory:directory_v1-rev20240429-2.0.0") @@ -132,11 +118,6 @@ dependencies { api("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0") api("com.nhaarman:mockito-kotlin:1.6.0") api("com.ninja-squad:springmockk:2.0.3") - api("com.squareup.okhttp3:logging-interceptor:${versions.okhttp3}") - api("com.squareup.okhttp3:mockwebserver:${versions.okhttp3}") - api("com.squareup.okhttp3:okhttp-sse:${versions.okhttp3}") - api("com.squareup.okhttp3:okhttp-urlconnection:${versions.okhttp3}") - api("com.squareup.okhttp3:okhttp:${versions.okhttp3}") api("com.squareup.retrofit2:converter-jackson:${versions.retrofit2}") api("com.squareup.retrofit2:retrofit-mock:${versions.retrofit2}") api("com.squareup.retrofit2:retrofit:${versions.retrofit2}")