mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 18:54:58 +00:00
b5a879e1c2
- Add `-u <uri>` command line option to support `redis://` URI scheme. - included server connection information object (`struct cliConnInfo`), used to describe an ip:port pair, db num user input, and user:pass to avoid a large number of function arguments. - Using sds on connection info strings for redis-benchmark/redis-cli Co-authored-by: yoav-steinberg <yoav@monfort.co.il>
34 lines
987 B
Tcl
34 lines
987 B
Tcl
proc redisbenchmark_tls_config {testsdir} {
|
|
set tlsdir [file join $testsdir tls]
|
|
set cert [file join $tlsdir client.crt]
|
|
set key [file join $tlsdir client.key]
|
|
set cacert [file join $tlsdir ca.crt]
|
|
|
|
if {$::tls} {
|
|
return [list --tls --cert $cert --key $key --cacert $cacert]
|
|
} else {
|
|
return {}
|
|
}
|
|
}
|
|
|
|
proc redisbenchmark {host port {opts {}}} {
|
|
set cmd [list src/redis-benchmark -h $host -p $port]
|
|
lappend cmd {*}[redisbenchmark_tls_config "tests"]
|
|
lappend cmd {*}$opts
|
|
return $cmd
|
|
}
|
|
|
|
proc redisbenchmarkuri {host port {opts {}}} {
|
|
set cmd [list src/redis-benchmark -u redis://$host:$port]
|
|
lappend cmd {*}[redisbenchmark_tls_config "tests"]
|
|
lappend cmd {*}$opts
|
|
return $cmd
|
|
}
|
|
|
|
proc redisbenchmarkuriuserpass {host port user pass {opts {}}} {
|
|
set cmd [list src/redis-benchmark -u redis://$user:$pass@$host:$port]
|
|
lappend cmd {*}[redisbenchmark_tls_config "tests"]
|
|
lappend cmd {*}$opts
|
|
return $cmd
|
|
}
|