mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-05-05 06:07:48 +08:00
add delay
This commit is contained in:
parent
4e3701df77
commit
664b704e30
@ -15,6 +15,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
messageCount = flag.Int("n", 1000, "message count")
|
messageCount = flag.Int("n", 1000, "message count")
|
||||||
|
messageDelay = flag.Duration("d", time.Second, "delay between messages")
|
||||||
concurrency = flag.Int("c", 4, "concurrent publishers")
|
concurrency = flag.Int("c", 4, "concurrent publishers")
|
||||||
partitionCount = flag.Int("p", 6, "partition count")
|
partitionCount = flag.Int("p", 6, "partition count")
|
||||||
|
|
||||||
@ -34,8 +35,10 @@ func doPublish(publisher *pub_client.TopicPublisher, id int) {
|
|||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
time.Sleep(time.Second)
|
if *messageDelay > 0 {
|
||||||
// println("Published", string(key), string(value))
|
time.Sleep(*messageDelay)
|
||||||
|
fmt.Printf("sent %+v\n", myRecord)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if err := publisher.FinishPublish(); err != nil {
|
if err := publisher.FinishPublish(); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user