public abstract class JRedisBenchmark.BenchmarkWorker
extends java.lang.Object
implements java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
(package private) java.util.concurrent.CountDownLatch |
completion |
(package private) int |
db |
(package private) long[] |
deltas |
(package private) java.lang.String |
host |
(package private) int |
id |
(package private) JRedis |
jredis |
(package private) java.util.concurrent.CountDownLatch |
mark |
(package private) int |
port |
(package private) java.util.concurrent.CountDownLatch |
ready |
(package private) int |
reqCnt |
| Constructor and Description |
|---|
BenchmarkWorker(java.lang.String host,
int port,
int db) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
prep()
anything that needs to be done to setup the calls -- typically all time consuming data setup tasks go here ...
|
void |
run()
1 - connects to the redis server
|
protected abstract void |
work()
Typically just a tight loop calling the redis server for the given test and using the data prep'd in
prep() |
final java.lang.String host
final int port
long[] deltas
java.util.concurrent.CountDownLatch ready
java.util.concurrent.CountDownLatch completion
java.util.concurrent.CountDownLatch mark
int reqCnt
int id
int db
JRedis jredis
public void run()
1 - connects to the redis server
2 - calls the prep() -- subclasses will implement this
3 - waits for the mark signal to start the calls
4 - gets the sys time, and ..
5 - calls the work() method -- subclasses will implement this
6 - gets the sys time -- this is the time delta for this worker
7 - closes the connection, and signals completion to the benchmarker.
run in interface java.lang.Runnableprotected abstract void prep()
protected abstract void work()
prep()