diff --git a/pom.xml b/pom.xml index a6e2948..9fccae8 100644 --- a/pom.xml +++ b/pom.xml @@ -35,25 +35,6 @@ - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - - - prepare-agent - - - - report - test - - report - - - - maven-compiler-plugin 3.8.1 @@ -62,16 +43,6 @@ 1.8 - - maven-surefire-plugin - 2.22.2 - - - ${redis-hosts} - - - - diff --git a/src/main/java/com/zeekling/redis/speed/ExistsVSGet.java b/src/main/java/com/zeekling/redis/speed/ExistsVSGet.java new file mode 100644 index 0000000..8086774 --- /dev/null +++ b/src/main/java/com/zeekling/redis/speed/ExistsVSGet.java @@ -0,0 +1,37 @@ +package com.zeekling.redis.speed; + +import redis.clients.jedis.Jedis; + +/** + * @author zeekling + */ +public class ExistsVSGet { + + private static final Jedis jedis = new Jedis("127.0.0.1", 6379); + + private static void exists() { + long begin = System.nanoTime(); + jedis.exists("key_aaaaaaa"); + long end = System.nanoTime(); + System.out.println("exists cost=" + (end - begin)/1000); + } + private static void get() { + long begin = System.nanoTime(); + jedis.exists("key_aaaaaaa"); + long end = System.nanoTime(); + System.out.println("get cost=" + (end - begin)/1000); + } + + private static void test() { + for (int i=1; i< 10; i++) { + jedis.get("0000000" + i); + } + } + + public static void main(String[] args) { + ExistsVSGet.test(); + ExistsVSGet.get(); + ExistsVSGet.exists(); + } + +} diff --git a/src/main/java/com/zeekling/redis/speed/FillData.java b/src/main/java/com/zeekling/redis/speed/FillData.java new file mode 100644 index 0000000..d7b744a --- /dev/null +++ b/src/main/java/com/zeekling/redis/speed/FillData.java @@ -0,0 +1,29 @@ +package com.zeekling.redis.speed; + +import redis.clients.jedis.Jedis; +import redis.clients.jedis.params.SetParams; + +/** + * @author zeekling + */ +public class FillData { + + private static final Jedis jedis = new Jedis("127.0.0.1", 6379); + + private static void fillData(long min, long max, SetParams params) { + for (long i = min; i < max; i++) { + jedis.set("key_0000000" + i, "value_0000000" + i, params); + if (i % 1000 == 0) { + System.out.println("count=" + i); + } + } + } + + public static void main(String[] args) { + SetParams params = new SetParams(); + FillData.fillData(0, 5000000, params); + params.ex(50000L); + FillData.fillData(50000000, 55000000, params); + } + +} diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..41ed41b --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Thu Nov 10 22:51:03 HKT 2022 +groupId=com.zeekling.redis +artifactId=jedis-test +version=1.0-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..2de10b5 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,4 @@ +com/zeekling/redis/lock/RedisDistributedLockImpl.class +com/zeekling/redis/JedisClusterTest.class +com/zeekling/redis/RedisPool.class +com/zeekling/redis/lock/DistributedLock.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..69788dc --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,4 @@ +/home/zeekling/project/gitea/redis-test/src/main/java/com/zeekling/redis/lock/RedisDistributedLockImpl.java +/home/zeekling/project/gitea/redis-test/src/main/java/com/zeekling/redis/JedisClusterTest.java +/home/zeekling/project/gitea/redis-test/src/main/java/com/zeekling/redis/lock/DistributedLock.java +/home/zeekling/project/gitea/redis-test/src/main/java/com/zeekling/redis/RedisPool.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..4d4b863 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1,2 @@ +com/zeekling/redis/RedisDistributedLockTest.class +com/zeekling/redis/RedisPoolTest.class diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..c3f06a7 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1,2 @@ +/home/zeekling/project/gitea/redis-test/src/test/java/com/zeekling/redis/RedisDistributedLockTest.java +/home/zeekling/project/gitea/redis-test/src/test/java/com/zeekling/redis/RedisPoolTest.java