Fixed small bug in the benchmark test

This commit is contained in:
Jonathan Leibiusky
2010-09-14 14:17:10 -03:00
parent 703244c85e
commit 708ae8a56e

View File

@@ -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);