1
0

gen_write_load.tcl 459 B

123456789101112131415161718
  1. source tests/support/redis.tcl
  2. set ::tlsdir "tests/tls"
  3. proc gen_write_load {host port seconds tls} {
  4. set start_time [clock seconds]
  5. set r [redis $host $port 1 $tls]
  6. $r client setname LOAD_HANDLER
  7. $r select 9
  8. while 1 {
  9. $r set [expr rand()] [expr rand()]
  10. if {[clock seconds]-$start_time > $seconds} {
  11. exit 0
  12. }
  13. }
  14. }
  15. gen_write_load [lindex $argv 0] [lindex $argv 1] [lindex $argv 2] [lindex $argv 3]