Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into csc.docs
Browse files Browse the repository at this point in the history
  • Loading branch information
filipecosta90 committed Oct 30, 2023
2 parents 272b110 + a653bbf commit 1eb9551
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions redis-bechmark-go.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ func main() {
port := flag.Int("p", 12000, "Server port.")
rps := flag.Int64("rps", 0, "Max rps. If 0 no limit is applied and the DB is stressed up to maximum.")
rpsburst := flag.Int64("rps-burst", 0, "Max rps burst. If 0 the allowed burst will be the ammount of clients.")
username := flag.String("u", "", "Username for Redis Auth.")
password := flag.String("a", "", "Password for Redis Auth.")
jsonOutFile := flag.String("json-out-file", "", "Results file. If empty will not save.")
seed := flag.Int64("random-seed", 12345, "random seed to be used.")
Expand Down Expand Up @@ -264,6 +265,9 @@ func main() {
if *password != "" {
opts.AuthPass = *password
}
if *username != "" {
opts.AuthUser = *username
}
alwaysRESP2 := false
if *resp == "2" {
opts.Protocol = "2"
Expand Down Expand Up @@ -325,6 +329,7 @@ func main() {
}
clientOptions := rueidis.ClientOption{
InitAddress: []string{connectionStr},
Username: *username,
Password: *password,
AlwaysPipelining: false,
AlwaysRESP2: alwaysRESP2,
Expand Down
2 changes: 2 additions & 0 deletions redis-bechmark-go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ func TestGecko(t *testing.T) {
args []string
}{
{"simple run", 0, 1, 100, []string{"-p", "6379", "-c", "10", "-n", "100", "HSET", "hash:1", "field", "value"}},
{"simple run username", 0, 1, 100, []string{"-p", "6379", "-u", "default", "-c", "10", "-n", "100", "HSET", "hash:1", "field", "value"}},
{"simple run rueidis", 0, 1, 100, []string{"-p", "6379", "-rueidis", "-c", "10", "-n", "100", "HSET", "hash:1", "field", "value"}},
{"simple run rueidis username", 0, 1, 100, []string{"-p", "6379", "-rueidis", "-u", "default", "-c", "10", "-n", "100", "HSET", "hash:1", "field", "value"}},
{"run with multi-exec rueidis", 0, 1, 100, []string{"-p", "6379", "-rueidis", "-multi", "-c", "10", "-n", "100", "-rps", "100", "HSET", "hash:1", "field", "value"}},
{"run with rps", 0, 1, 100, []string{"-p", "6379", "-c", "10", "-n", "100", "-rps", "100", "HSET", "hash:1", "field", "value"}},
{"run with rps rueidis", 0, 1, 100, []string{"-p", "6379", "-rueidis", "-c", "10", "-n", "100", "-rps", "100", "HSET", "hash:1", "field", "value"}},
Expand Down

0 comments on commit 1eb9551

Please sign in to comment.