Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docker/gorgon_couchbase/control/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ ADD src.tgz /
WORKDIR /src/gorgon_couchbase
RUN go build

RUN mkdir /root/store

WORKDIR /root
COPY init.sh run.sh /
COPY workloads/ /workloads/
Expand Down
18 changes: 18 additions & 0 deletions src/gorgon/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,12 @@ func parseOptions(opt *gorgon.Options, filter *Filter) int {
matchPattern := "*"
excludePattern := ""
nodes := "localhost"
storeDir := ""

flag.StringVar(&matchPattern, "gorgon-match", matchPattern, "Wildcard pattern for scenarios to run")
flag.StringVar(&excludePattern, "gorgon-exclude", excludePattern, "Wildcard pattern for scenarios to exclude")
flag.StringVar(&nodes, "gorgon-nodes", nodes, "Comma-separated list of nodes")
flag.StringVar(&storeDir, "gorgon-store-dir", storeDir, "Directory to store artefacts (defaults to working directory)")
flag.DurationVar(&opt.WorkloadDuration, "gorgon-workload-duration", opt.WorkloadDuration, "Intended workload/nemesis duration")
flag.IntVar(&opt.Concurrency, "gorgon-concurrency", opt.Concurrency, "Number of clients to use")
flag.BoolVar(&opt.ContinueAmbiguousClient, "gorgon-continue-ambiguous-client", false,
Expand All @@ -131,6 +133,22 @@ func parseOptions(opt *gorgon.Options, filter *Filter) int {
return usage()
}

if storeDir != "" {
if info, err := os.Stat(storeDir); err == nil && info.IsDir() {
opt.StoreDir = storeDir
} else {
log.Warning("Store directory %q does not exist, falling back to working directory", storeDir)
}
}
if opt.StoreDir == "" {
pwd, err := os.Getwd()
if err != nil {
fmt.Println("Failed to resolve working directory:", err)
return 1
}
opt.StoreDir = pwd
}

// Skip command name (args[0]) to keep only workload-specific arguments
opt.Args = flag.Args()[1:]

Expand Down
1 change: 1 addition & 0 deletions src/gorgon/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type Options struct {
ContinueAmbiguousClient bool
RpcPort int
RpcPassword string
StoreDir string
}

type Operation struct {
Expand Down