Fixed small bug in the benchmark test
This commit is contained in:
@@ -25,7 +25,7 @@ public class PoolBenchmark {
|
|||||||
// withoutPool();
|
// withoutPool();
|
||||||
withPool();
|
withPool();
|
||||||
long elapsed = System.currentTimeMillis() - t;
|
long elapsed = System.currentTimeMillis() - t;
|
||||||
System.out.println(((1000 * 2 * TOTAL_OPERATIONS) / elapsed) + " ops");
|
System.out.println(((1000 * 3 * TOTAL_OPERATIONS) / elapsed) + " ops");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void withoutPool() throws InterruptedException {
|
private static void withoutPool() throws InterruptedException {
|
||||||
@@ -73,6 +73,7 @@ public class PoolBenchmark {
|
|||||||
for (int i = 0; (i = ind.getAndIncrement()) < TOTAL_OPERATIONS;) {
|
for (int i = 0; (i = ind.getAndIncrement()) < TOTAL_OPERATIONS;) {
|
||||||
try {
|
try {
|
||||||
Jedis j = pool.getResource();
|
Jedis j = pool.getResource();
|
||||||
|
j.auth("foobared");
|
||||||
final String key = "foo" + i;
|
final String key = "foo" + i;
|
||||||
j.set(key, key);
|
j.set(key, key);
|
||||||
j.get(key);
|
j.get(key);
|
||||||
|
|||||||
Reference in New Issue
Block a user