File: gen_write_load.tcl

package info (click to toggle)
redis 3%3A3.2.6-3%2Bdeb9u3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,412 kB
  • sloc: ansic: 90,454; tcl: 12,122; perl: 4,046; sh: 4,006; ruby: 1,593; makefile: 1,064
file content (15 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
source tests/support/redis.tcl

proc gen_write_load {host port seconds} {
    set start_time [clock seconds]
    set r [redis $host $port 1]
    $r select 9
    while 1 {
        $r set [expr rand()] [expr rand()]
        if {[clock seconds]-$start_time > $seconds} {
            exit 0
        }
    }
}

gen_write_load [lindex $argv 0] [lindex $argv 1] [lindex $argv 2]