Merge pull request #14 from coreos/readme

*: minor clean up
This commit is contained in:
Gyu-Ho Lee 2016-03-25 09:16:20 -07:00
commit 8158b577af
4 changed files with 30 additions and 12 deletions

View File

@ -513,7 +513,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error {
plotAvgLatency.Title.Text = fmt.Sprintf("%s, Latency", imageTitle) plotAvgLatency.Title.Text = fmt.Sprintf("%s, Latency", imageTitle)
plotAvgLatency.X.Label.Text = "second" plotAvgLatency.X.Label.Text = "second"
plotAvgLatency.Y.Label.Text = "latency(ms)" plotAvgLatency.Y.Label.Text = "latency(ms)"
if err := plotutil.AddLinePoints( if err = plotutil.AddLinePoints(
plotAvgLatency, plotAvgLatency,
"consul", plotAvgLatencyConsulPoints, "consul", plotAvgLatencyConsulPoints,
"etcd3", plotAvgLatencyEtcd3Points, "etcd3", plotAvgLatencyEtcd3Points,
@ -522,7 +522,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error {
); err != nil { ); err != nil {
return err return err
} }
if err := plotAvgLatency.Save(defaultSize, defaultSize, avgLatencyPath); err != nil { if err = plotAvgLatency.Save(defaultSize, defaultSize, avgLatencyPath); err != nil {
return err return err
} }
@ -565,7 +565,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error {
plotThroughput.Title.Text = fmt.Sprintf("%s, Throughput", imageTitle) plotThroughput.Title.Text = fmt.Sprintf("%s, Throughput", imageTitle)
plotThroughput.X.Label.Text = "second" plotThroughput.X.Label.Text = "second"
plotThroughput.Y.Label.Text = "Throughput" plotThroughput.Y.Label.Text = "Throughput"
if err := plotutil.AddLinePoints( if err = plotutil.AddLinePoints(
plotThroughput, plotThroughput,
"consul", plotThroughputConsulPoints, "consul", plotThroughputConsulPoints,
"etcd3", plotThroughputEtcd3Points, "etcd3", plotThroughputEtcd3Points,
@ -574,7 +574,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error {
); err != nil { ); err != nil {
return err return err
} }
if err := plotThroughput.Save(defaultSize, defaultSize, throughputPath); err != nil { if err = plotThroughput.Save(defaultSize, defaultSize, throughputPath); err != nil {
return err return err
} }
@ -617,7 +617,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error {
plotAvgCpu.Title.Text = fmt.Sprintf("%s, CPU", imageTitle) plotAvgCpu.Title.Text = fmt.Sprintf("%s, CPU", imageTitle)
plotAvgCpu.X.Label.Text = "second" plotAvgCpu.X.Label.Text = "second"
plotAvgCpu.Y.Label.Text = "CPU" plotAvgCpu.Y.Label.Text = "CPU"
if err := plotutil.AddLinePoints( if err = plotutil.AddLinePoints(
plotAvgCpu, plotAvgCpu,
"consul", plotAvgCpuConsulPoints, "consul", plotAvgCpuConsulPoints,
"etcd3", plotAvgCpuEtcd3Points, "etcd3", plotAvgCpuEtcd3Points,
@ -626,7 +626,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error {
); err != nil { ); err != nil {
return err return err
} }
if err := plotAvgCpu.Save(defaultSize, defaultSize, avgCpuPath); err != nil { if err = plotAvgCpu.Save(defaultSize, defaultSize, avgCpuPath); err != nil {
return err return err
} }
@ -669,7 +669,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error {
plotAvgMem.Title.Text = fmt.Sprintf("%s, Memory", imageTitle) plotAvgMem.Title.Text = fmt.Sprintf("%s, Memory", imageTitle)
plotAvgMem.X.Label.Text = "second" plotAvgMem.X.Label.Text = "second"
plotAvgMem.Y.Label.Text = "Memory(MB)" plotAvgMem.Y.Label.Text = "Memory(MB)"
if err := plotutil.AddLinePoints( if err = plotutil.AddLinePoints(
plotAvgMem, plotAvgMem,
"consul", plotAvgMemConsulPoints, "consul", plotAvgMemConsulPoints,
"etcd3", plotAvgMemEtcd3Points, "etcd3", plotAvgMemEtcd3Points,
@ -678,7 +678,7 @@ func plotAggAgg(fpath, outputPath, imageFormat, imageTitle string) error {
); err != nil { ); err != nil {
return err return err
} }
if err := plotAvgMem.Save(defaultSize, defaultSize, avgMemPath); err != nil { if err = plotAvgMem.Save(defaultSize, defaultSize, avgMemPath); err != nil {
return err return err
} }

21
analyze/readme.go Normal file
View File

@ -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
}

View File

@ -61,6 +61,7 @@ func init() {
func init() { func init() {
rootCommand.AddCommand(agent.Command) rootCommand.AddCommand(agent.Command)
rootCommand.AddCommand(analyze.Command) rootCommand.AddCommand(analyze.Command)
rootCommand.AddCommand(analyze.ReadmeCommand)
rootCommand.AddCommand(bench.Command) rootCommand.AddCommand(bench.Command)
rootCommand.AddCommand(control.StartCommand) rootCommand.AddCommand(control.StartCommand)
rootCommand.AddCommand(control.StopCommand) rootCommand.AddCommand(control.StopCommand)

View File

@ -23,10 +23,6 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
// TODO: vendor gRPC and combine this into bench
// Currently, we get:
// panic: http: multiple registrations for /debug/requests
var ( var (
Command = &cobra.Command{ Command = &cobra.Command{
Use: "upload", Use: "upload",