aboutsummaryrefslogtreecommitdiff
path: root/weed/command/benchmark.go
diff options
context:
space:
mode:
authorzhangsong <zhangsong@cloudwalk.cn>2020-04-30 23:31:08 +0800
committerzhangsong <zhangsong@cloudwalk.cn>2020-04-30 23:31:08 +0800
commitd819865fe7036ec64a28d896aca61ba8b3a39d02 (patch)
tree1ef053596934a7b8a59a772d542c8c90c7d63cba /weed/command/benchmark.go
parentea809a45abcd4b862cd879f6eadc6d34e73e2c40 (diff)
downloadseaweedfs-d819865fe7036ec64a28d896aca61ba8b3a39d02.tar.xz
seaweedfs-d819865fe7036ec64a28d896aca61ba8b3a39d02.zip
add fsync option for benchmark
Diffstat (limited to 'weed/command/benchmark.go')
-rw-r--r--weed/command/benchmark.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.go
index a73a4e81c..5b2e31622 100644
--- a/weed/command/benchmark.go
+++ b/weed/command/benchmark.go
@@ -42,6 +42,7 @@ type BenchmarkOptions struct {
grpcDialOption grpc.DialOption
masterClient *wdclient.MasterClient
grpcRead *bool
+ fsync *bool
}
var (
@@ -67,6 +68,7 @@ func init() {
b.cpuprofile = cmdBenchmark.Flag.String("cpuprofile", "", "cpu profile output file")
b.maxCpu = cmdBenchmark.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs")
b.grpcRead = cmdBenchmark.Flag.Bool("grpcRead", false, "use grpc API to read")
+ b.fsync = cmdBenchmark.Flag.Bool("fsync", false, "flush data to disk after write")
sharedBytes = make([]byte, 1024)
}
@@ -230,6 +232,7 @@ func writeFiles(idChan chan int, fileIdLineChan chan string, s *stat) {
Reader: &FakeReader{id: uint64(id), size: fileSize, random: random},
FileSize: fileSize,
MimeType: "image/bench", // prevent gzip benchmark content
+ Fsync: *b.fsync,
}
ar := &operation.VolumeAssignRequest{
Count: 1,