public abstract class JRedisBenchmark extends Object
SocketConnection
, using a concurrent set of workers, each with its own
unique connection to the Redis server.Modifier and Type | Class and Description |
---|---|
static class |
JRedisBenchmark.Benchmarker |
class |
JRedisBenchmark.BenchmarkWorker
Abstract base class for all benchmark workers.
|
Modifier and Type | Field and Description |
---|---|
static String |
password
password used to AUTH with redis select -- password is: jredis
|
protected boolean |
quitOnRunEnd |
Constructor and Description |
---|
JRedisBenchmark() |
Modifier and Type | Method and Description |
---|---|
protected abstract Class<? extends JRedis> |
getImplementationClass() |
protected abstract JRedis |
newConnection(String host,
int port,
int db,
String password)
Define this method to test a specific JRedis implementation.
|
JRedisBenchmark.BenchmarkWorker |
newDbsizeWorker(String host,
int port,
int db)
does the DBSIZE
|
JRedisBenchmark.BenchmarkWorker |
newDecrbyWorker(String host,
int port,
int db)
does the DECR
|
JRedisBenchmark.BenchmarkWorker |
newDecrWorker(String host,
int port,
int db)
does the DECR
|
JRedisBenchmark.BenchmarkWorker |
newGetWorker(String host,
int port,
int db)
does the GET
|
JRedisBenchmark.BenchmarkWorker |
newIncrbyWorker(String host,
int port,
int db)
does the INCRBY
|
JRedisBenchmark.BenchmarkWorker |
newIncrWorker(String host,
int port,
int db)
does the INCR
|
JRedisBenchmark.BenchmarkWorker |
newLLenWorker(String host,
int port,
int db)
does the LLEN
|
JRedisBenchmark.BenchmarkWorker |
newLPopWorker(String host,
int port,
int db)
does the LPOP
|
JRedisBenchmark.BenchmarkWorker |
newLPushWorker(String host,
int port,
int db)
does the LPUSH
|
JRedisBenchmark.BenchmarkWorker |
newPingWorker(String host,
int port,
int db)
does the PING
|
JRedisBenchmark.BenchmarkWorker |
newRPopWorker(String host,
int port,
int db)
does the RPOP
|
JRedisBenchmark.BenchmarkWorker |
newRPushWorker(String host,
int port,
int db)
does the RPUSH
|
JRedisBenchmark.BenchmarkWorker |
newSaddWorker(String host,
int port,
int db)
does the SADD
|
JRedisBenchmark.BenchmarkWorker |
newScardWorker(String host,
int port,
int db)
does the SCARD
|
JRedisBenchmark.BenchmarkWorker |
newSetnxWorker(String host,
int port,
int db)
does the SETNX
|
JRedisBenchmark.BenchmarkWorker |
newSetWorker(String host,
int port,
int db)
does the SET
|
JRedisBenchmark.BenchmarkWorker |
newSmembersWorker(String host,
int port,
int db)
does the SMEMBERS
|
JRedisBenchmark.BenchmarkWorker |
newSremWorker(String host,
int port,
int db)
does the SREM
|
protected void |
quitOnRunEnd(boolean flag) |
protected void |
runBenchmarks(String host,
int port,
int threadCnt,
int reqCnt,
int size,
int db)
Runs a set of command primitives test runs using concurrent clients.
|
public static final String password
protected boolean quitOnRunEnd
protected void quitOnRunEnd(boolean flag)
b
- protected abstract JRedis newConnection(String host, int port, int db, String password) throws ClientRuntimeException
host
- port
- ClientRuntimeException
protected final void runBenchmarks(String host, int port, int threadCnt, int reqCnt, int size, int db)
Be advised that this will FLUSH the db specified. Defaults to database at index 13: i.e. jredis.select(13).flushdb()
.
This bench will use AUTH
to make sure you do not accidentally destroy important data
when runnign the benchmark. (If you don't have a password on your db, it can't be that important, right?)
Further note that this will use the password jredis
so either
make sure the redis.conf requirepass
is set appropriately or simply comment it out.
host
- port
- threadCnt
- reqCnt
- size
- db
- public final JRedisBenchmark.BenchmarkWorker newPingWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newDbsizeWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newSaddWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newSremWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newScardWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newLLenWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newLPopWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newRPopWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newLPushWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newRPushWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newIncrWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newDecrWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newIncrbyWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newDecrbyWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newSetWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newSetnxWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newGetWorker(String host, int port, int db)
public final JRedisBenchmark.BenchmarkWorker newSmembersWorker(String host, int port, int db)
Copyright © 2009–2019. All rights reserved.