gen_write_load.tcl 424 B

1234567891011121314151617
  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 select 9
  7. while 1 {
  8. $r set [expr rand()] [expr rand()]
  9. if {[clock seconds]-$start_time > $seconds} {
  10. exit 0
  11. }
  12. }
  13. }
  14. gen_write_load [lindex $argv 0] [lindex $argv 1] [lindex $argv 2] [lindex $argv 3]