Skip to content

Commit

Permalink
feat(benchmark): add a test command to the benchmark tool
Browse files Browse the repository at this point in the history
This patch adds a new command `test` to the benchmark tool. It runs benchmark testing that is
already implemented. We will add more commands like save and serve to support various
functionalities.

Resolves #257
  • Loading branch information
ijsong committed Dec 8, 2022
1 parent 182136a commit 0e08249
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions cmd/benchmark/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ func run() int {
func newApp() *cli.App {
app := &cli.App{
Name: "benchmark",
Commands: []*cli.Command{
newCommandTest(),
},
}
return app
}

func newCommandTest() *cli.Command {
return &cli.Command{
Name: "test",
Usage: "run benchmark test",
Flags: []cli.Flag{
flagClusterID,
flagTarget,
Expand All @@ -86,12 +97,11 @@ func newApp() *cli.App {
flagDuration,
flagReportInterval,
},
Action: start,
Action: runCommandTest,
}
return app
}

func start(c *cli.Context) error {
func runCommandTest(c *cli.Context) error {
if c.NArg() > 0 {
return fmt.Errorf("unexpected args: %v", c.Args().Slice())
}
Expand Down

0 comments on commit 0e08249

Please sign in to comment.