From 0236cca1d263e985f6593052fc0739fc7f911864 Mon Sep 17 00:00:00 2001 From: mitch Date: Tue, 4 Jan 2022 17:56:00 -0500 Subject: [PATCH] Updated README --- README.md | 25 +++++++++++++++++++++++-- redisLoadTest.go | 4 +++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0d02cfe..327f962 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,31 @@ -#Redis Load Test +# Redis Load Test A simple program to perform load testing against a redis instance ## Requirements -- go compiler +- go compiler (only tested on go1.17) ## Install +`make build` for docker installation +for local installation: +``` +make build-local +mv redisLoadTest /usr/local/bin/ +``` ## Commands +``` +-host=$REMOTE_HOST +-username=string --not implemented yet +-password=string --not implemented yet +-db=int --not implemented yet +-initialize=bool defaults to false, initializes database +-rate=int defautls to 50 at int / second +-burst=bool defaults to true performs burst test along with steady rate test +-dbEntries=int defaults to 50000 number of database entries to add +-duration=int defaults to 10 for each test duration in seconds +``` +## sample usage +``` +redisLoadTest -host=MyCoolServer -initialize=true -rate=60 -duration=60 +``` \ No newline at end of file diff --git a/redisLoadTest.go b/redisLoadTest.go index 14ad9fc..6345652 100644 --- a/redisLoadTest.go +++ b/redisLoadTest.go @@ -51,7 +51,9 @@ func getRateTest(rdbPtr *redis.Conn, rate int, keyMaxValue int, duration time.Du rateLimiter := time.Tick(time.Millisecond * time.Duration(x)) fmt.Println("Starting Test at", rateLimiter, "milliseconds per request...") - + // select { + // case <- time.After(10 * time.Second): + // fmt.Fprintf(w, "hello\n") go func() { for i := 0; i < int(duration.Seconds()); i++ { fmt.Println(i, int(duration.Seconds()))