Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
25447: cmd/workload: remove benchmark result output r=tschottdorf a=petermattis

Nothing was using the benchmark result output.

Fix specification of a url during `run` and `init` commands.

Release note: None

Co-authored-by: Peter Mattis <[email protected]>
  • Loading branch information
craig[bot] and petermattis committed May 13, 2018
2 parents bb2a4fd + 12f46b5 commit 1ca8e6b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pkg/cmd/workload/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"sync"
"sync/atomic"
"syscall"
"testing"
"time"

"golang.org/x/time/rate"
Expand Down Expand Up @@ -76,13 +75,21 @@ func init() {
genFlags = f.Flags().FlagSet
}

genInitCmd := setCmdDefaults(&cobra.Command{Use: meta.Name, Short: meta.Description})
genInitCmd := setCmdDefaults(&cobra.Command{
Use: meta.Name,
Short: meta.Description,
Args: cobra.ArbitraryArgs,
})
genInitCmd.Flags().AddFlagSet(initFlags)
genInitCmd.Flags().AddFlagSet(genFlags)
genInitCmd.Run = cmdHelper(gen, runInit)
initCmd.AddCommand(genInitCmd)

genRunCmd := setCmdDefaults(&cobra.Command{Use: meta.Name, Short: meta.Description})
genRunCmd := setCmdDefaults(&cobra.Command{
Use: meta.Name,
Short: meta.Description,
Args: cobra.ArbitraryArgs,
})
genRunCmd.Flags().AddFlagSet(runFlags)
genRunCmd.Flags().AddFlagSet(genFlags)
initFlags.VisitAll(func(initFlag *pflag.Flag) {
Expand Down Expand Up @@ -372,8 +379,6 @@ func runRun(gen workload.Generator, urls []string, dbName string) error {
benchmarkName += fmt.Sprintf(`/%s=%s`, f.Name, f.Value)
})
}
result := testing.BenchmarkResult{N: int(resultTick.Ops), T: startElapsed}
fmt.Printf("\n%s\t%s\n", benchmarkName, result)

if *histFile == "-" {
if err := histwriter.WriteDistribution(
Expand Down

0 comments on commit 1ca8e6b

Please sign in to comment.