2024-04-23 13:51:53 -04:00
|
|
|
proc valkeybenchmark_tls_config {testsdir} {
|
2020-10-28 06:00:54 +00:00
|
|
|
set tlsdir [file join $testsdir tls]
|
2020-12-11 18:31:40 +02:00
|
|
|
set cert [file join $tlsdir client.crt]
|
|
|
|
set key [file join $tlsdir client.key]
|
2020-10-28 06:00:54 +00:00
|
|
|
set cacert [file join $tlsdir ca.crt]
|
|
|
|
|
|
|
|
if {$::tls} {
|
|
|
|
return [list --tls --cert $cert --key $key --cacert $cacert]
|
|
|
|
} else {
|
|
|
|
return {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-23 13:51:53 -04:00
|
|
|
proc valkeybenchmark {host port {opts {}}} {
|
2024-03-28 09:58:28 -07:00
|
|
|
set cmd [list src/valkey-benchmark -h $host -p $port]
|
2024-04-23 13:51:53 -04:00
|
|
|
lappend cmd {*}[valkeybenchmark_tls_config "tests"]
|
2020-10-26 06:04:59 +00:00
|
|
|
lappend cmd {*}$opts
|
|
|
|
return $cmd
|
|
|
|
}
|
2021-09-14 17:45:06 +01:00
|
|
|
|
2024-04-23 13:51:53 -04:00
|
|
|
proc valkeybenchmarkuri {host port {opts {}}} {
|
2024-04-23 09:02:41 +08:00
|
|
|
set cmd [list src/valkey-benchmark -u valkey://$host:$port]
|
2024-04-23 13:51:53 -04:00
|
|
|
lappend cmd {*}[valkeybenchmark_tls_config "tests"]
|
2021-09-14 17:45:06 +01:00
|
|
|
lappend cmd {*}$opts
|
|
|
|
return $cmd
|
|
|
|
}
|
|
|
|
|
2024-04-23 13:51:53 -04:00
|
|
|
proc valkeybenchmarkuriuserpass {host port user pass {opts {}}} {
|
2024-04-23 09:02:41 +08:00
|
|
|
set cmd [list src/valkey-benchmark -u valkey://$user:$pass@$host:$port]
|
2024-04-23 13:51:53 -04:00
|
|
|
lappend cmd {*}[valkeybenchmark_tls_config "tests"]
|
2021-09-14 17:45:06 +01:00
|
|
|
lappend cmd {*}$opts
|
|
|
|
return $cmd
|
|
|
|
}
|