mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add optional delay
This commit is contained in:
parent
a243d7e047
commit
67949e25e9
|
@ -16,6 +16,7 @@ var (
|
||||||
n = flag.Int("n", 100, "the number of metadata")
|
n = flag.Int("n", 100, "the number of metadata")
|
||||||
tailFiler = flag.String("filer", "localhost:8888", "the filer address")
|
tailFiler = flag.String("filer", "localhost:8888", "the filer address")
|
||||||
isWrite = flag.Bool("write", false, "only write")
|
isWrite = flag.Bool("write", false, "only write")
|
||||||
|
writeInterval = flag.Duration("writeInterval", 0, "write interval, e.g., 1s")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -54,6 +55,7 @@ func startGenerateMetadata() {
|
||||||
|
|
||||||
for i := 0; i < *n; i++ {
|
for i := 0; i < *n; i++ {
|
||||||
name := fmt.Sprintf("file%d", i)
|
name := fmt.Sprintf("file%d", i)
|
||||||
|
glog.V(0).Infof("write %s/%s", *dir, name)
|
||||||
if err := filer_pb.CreateEntry(client, &filer_pb.CreateEntryRequest{
|
if err := filer_pb.CreateEntry(client, &filer_pb.CreateEntryRequest{
|
||||||
Directory: *dir,
|
Directory: *dir,
|
||||||
Entry: &filer_pb.Entry{
|
Entry: &filer_pb.Entry{
|
||||||
|
@ -63,6 +65,9 @@ func startGenerateMetadata() {
|
||||||
fmt.Printf("create entry %s: %v\n", name, err)
|
fmt.Printf("create entry %s: %v\n", name, err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if *writeInterval > 0 {
|
||||||
|
time.Sleep(*writeInterval)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue