From e16bfa41883abd8009cfb02b84c709ac0d45d5e9 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Fri, 25 Mar 2016 09:15:16 -0700 Subject: [PATCH] *: minor clean up --- analyze/analyze.go | 16 ++++++++-------- analyze/readme.go | 21 +++++++++++++++++++++ main.go | 1 + upload/upload.go | 4 ---- 4 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 analyze/readme.go diff --git a/analyze/analyze.go b/analyze/analyze.go index e12683fa..1c36f643 100644 --- a/analyze/analyze.go +++ b/analyze/analyze.go @@ -513,7 +513,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error { plotAvgLatency.Title.Text = fmt.Sprintf("%s, Latency", imageTitle) plotAvgLatency.X.Label.Text = "second" plotAvgLatency.Y.Label.Text = "latency(ms)" - if err := plotutil.AddLinePoints( + if err = plotutil.AddLinePoints( plotAvgLatency, "consul", plotAvgLatencyConsulPoints, "etcd3", plotAvgLatencyEtcd3Points, @@ -522,7 +522,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error { ); err != nil { return err } - if err := plotAvgLatency.Save(defaultSize, defaultSize, avgLatencyPath); err != nil { + if err = plotAvgLatency.Save(defaultSize, defaultSize, avgLatencyPath); err != nil { return err } @@ -565,7 +565,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error { plotThroughput.Title.Text = fmt.Sprintf("%s, Throughput", imageTitle) plotThroughput.X.Label.Text = "second" plotThroughput.Y.Label.Text = "Throughput" - if err := plotutil.AddLinePoints( + if err = plotutil.AddLinePoints( plotThroughput, "consul", plotThroughputConsulPoints, "etcd3", plotThroughputEtcd3Points, @@ -574,7 +574,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error { ); err != nil { return err } - if err := plotThroughput.Save(defaultSize, defaultSize, throughputPath); err != nil { + if err = plotThroughput.Save(defaultSize, defaultSize, throughputPath); err != nil { return err } @@ -617,7 +617,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error { plotAvgCpu.Title.Text = fmt.Sprintf("%s, CPU", imageTitle) plotAvgCpu.X.Label.Text = "second" plotAvgCpu.Y.Label.Text = "CPU" - if err := plotutil.AddLinePoints( + if err = plotutil.AddLinePoints( plotAvgCpu, "consul", plotAvgCpuConsulPoints, "etcd3", plotAvgCpuEtcd3Points, @@ -626,7 +626,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error { ); err != nil { return err } - if err := plotAvgCpu.Save(defaultSize, defaultSize, avgCpuPath); err != nil { + if err = plotAvgCpu.Save(defaultSize, defaultSize, avgCpuPath); err != nil { return err } @@ -669,7 +669,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error { plotAvgMem.Title.Text = fmt.Sprintf("%s, Memory", imageTitle) plotAvgMem.X.Label.Text = "second" plotAvgMem.Y.Label.Text = "Memory(MB)" - if err := plotutil.AddLinePoints( + if err = plotutil.AddLinePoints( plotAvgMem, "consul", plotAvgMemConsulPoints, "etcd3", plotAvgMemEtcd3Points, @@ -678,7 +678,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error { ); err != nil { return err } - if err := plotAvgMem.Save(defaultSize, defaultSize, avgMemPath); err != nil { + if err = plotAvgMem.Save(defaultSize, defaultSize, avgMemPath); err != nil { return err } diff --git a/analyze/readme.go b/analyze/readme.go new file mode 100644 index 00000000..5c750718 --- /dev/null +++ b/analyze/readme.go @@ -0,0 +1,21 @@ +package analyze + +import "github.com/spf13/cobra" + +var ( + ReadmeCommand = &cobra.Command{ + Use: "readme", + Short: "Generates README markdown.", + RunE: ReadmeCommandFunc, + } + + readmeDir string +) + +func init() { + ReadmeCommand.PersistentFlags().StringVarP(&readmeDir, "readme-dir", "d", "", "Directory path to generate README.") +} + +func ReadmeCommandFunc(cmd *cobra.Command, args []string) error { + return nil +} diff --git a/main.go b/main.go index aac8cba9..9e7d77d6 100644 --- a/main.go +++ b/main.go @@ -61,6 +61,7 @@ func init() { func init() { rootCommand.AddCommand(agent.Command) rootCommand.AddCommand(analyze.Command) + rootCommand.AddCommand(analyze.ReadmeCommand) rootCommand.AddCommand(bench.Command) rootCommand.AddCommand(control.StartCommand) rootCommand.AddCommand(control.StopCommand) diff --git a/upload/upload.go b/upload/upload.go index d26b4586..81c17393 100644 --- a/upload/upload.go +++ b/upload/upload.go @@ -23,10 +23,6 @@ import ( "github.com/spf13/cobra" ) -// TODO: vendor gRPC and combine this into bench -// Currently, we get: -// panic: http: multiple registrations for /debug/requests - var ( Command = &cobra.Command{ Use: "upload",