Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

add delay

chrislu664b704e307b
diff --git a/weed/mq/client/cmd/weed_pub_record/publisher_record.go b/weed/mq/client/cmd/weed_pub_record/publisher_record.go
index 6a8b01371d..4d4e5fc4d7 100644
--- a/weed/mq/client/cmd/weed_pub_record/publisher_record.go
+++ b/weed/mq/client/cmd/weed_pub_record/publisher_record.go
@@ -15,6 +15,7 @@ import (
var (
messageCount = flag.Int("n", 1000, "message count")
+ messageDelay = flag.Duration("d", time.Second, "delay between messages")
concurrency = flag.Int("c", 4, "concurrent publishers")
partitionCount = flag.Int("p", 6, "partition count")
@@ -34,8 +35,10 @@ func doPublish(publisher *pub_client.TopicPublisher, id int) {
fmt.Println(err)
break
}
- time.Sleep(time.Second)
- // println("Published", string(key), string(value))
+ if *messageDelay > 0 {
+ time.Sleep(*messageDelay)
+ fmt.Printf("sent %+v\n", myRecord)
+ }
}
if err := publisher.FinishPublish(); err != nil {
fmt.Println(err)