aboutsummaryrefslogtreecommitdiff
path: root/weed/command/benchmark.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2019-03-20 16:02:38 -0400
committerJonathan Amsterdam <jba@google.com>2019-03-20 16:02:38 -0400
commite966033098ce13fdda97dd96b309357bd410d8d6 (patch)
treedd401620f393d366e6c6ab80c15589eadfa2aea2 /weed/command/benchmark.go
parent8db82e2b75eb67bc58a4869cc70fb8c5b2c0b97c (diff)
parent977b30e992108e480c883cdd461bf0c8f6598f25 (diff)
downloadseaweedfs-e966033098ce13fdda97dd96b309357bd410d8d6.tar.xz
seaweedfs-e966033098ce13fdda97dd96b309357bd410d8d6.zip
Merge branch 'master' of https://github.com/chrislusf/seaweedfs into gocdk
Diffstat (limited to 'weed/command/benchmark.go')
-rw-r--r--weed/command/benchmark.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.go
index 44601e567..aa54946a7 100644
--- a/weed/command/benchmark.go
+++ b/weed/command/benchmark.go
@@ -36,6 +36,7 @@ type BenchmarkOptions struct {
read *bool
sequentialRead *bool
collection *string
+ replication *string
cpuprofile *string
maxCpu *int
grpcDialOption grpc.DialOption
@@ -61,6 +62,7 @@ func init() {
b.read = cmdBenchmark.Flag.Bool("read", true, "enable read")
b.sequentialRead = cmdBenchmark.Flag.Bool("readSequentially", false, "randomly read by ids from \"-list\" specified file")
b.collection = cmdBenchmark.Flag.String("collection", "benchmark", "write data to this collection")
+ b.replication = cmdBenchmark.Flag.String("replication", "000", "replication type")
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")
sharedBytes = make([]byte, 1024)
@@ -228,8 +230,9 @@ func writeFiles(idChan chan int, fileIdLineChan chan string, s *stat) {
MimeType: "image/bench", // prevent gzip benchmark content
}
ar := &operation.VolumeAssignRequest{
- Count: 1,
- Collection: *b.collection,
+ Count: 1,
+ Collection: *b.collection,
+ Replication: *b.replication,
}
if assignResult, err := operation.Assign(masterClient.GetMaster(), b.grpcDialOption, ar); err == nil {
fp.Server, fp.Fid, fp.Collection = assignResult.Url, assignResult.Fid, *b.collection