Last active
September 10, 2016 14:00
-
-
Save vmihailenco/1c790383011ebc388dc469a640a76514 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"strconv" | |
"time" | |
redis "gopkg.in/redis.v4" | |
) | |
func main() { | |
client := redis.NewClusterClient(&redis.ClusterOptions{ | |
Addrs: []string{":7000", ":7001", ":7002", ":7003", ":7004", ":7005"}, | |
}) | |
err := client.FlushAll().Err() | |
if err != nil { | |
log.Println(err) | |
} | |
for i := 0; i < 200; i++ { | |
key := "key " + strconv.Itoa(i) | |
value := "value " + strconv.Itoa(i) | |
_, err := client.Set(key, value,0).Result() | |
if err != nil { | |
log.Println(err) | |
} | |
} | |
for { | |
for i := 0; i < 200; i++ { | |
key := "key " + strconv.Itoa(i) | |
_, err := client.Get(key).Result() | |
if err != nil { | |
log.Println("err : ", err) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment