diff options
Diffstat (limited to 'cmd/swarm/swarm-smoke/main.go')
-rw-r--r-- | cmd/swarm/swarm-smoke/main.go | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/cmd/swarm/swarm-smoke/main.go b/cmd/swarm/swarm-smoke/main.go index 66cecdc5c..43d2c1ff5 100644 --- a/cmd/swarm/swarm-smoke/main.go +++ b/cmd/swarm/swarm-smoke/main.go @@ -37,18 +37,16 @@ var ( ) var ( - endpoints []string - includeLocalhost bool - cluster string - appName string - scheme string - filesize int - syncDelay int - from int - to int - verbosity int - timeout int - single bool + allhosts string + hosts []string + filesize int + syncDelay int + httpPort int + wsPort int + verbosity int + timeout int + single bool + trackTimeout int ) func main() { @@ -59,39 +57,22 @@ func main() { app.Flags = []cli.Flag{ cli.StringFlag{ - Name: "cluster-endpoint", - Value: "prod", - Usage: "cluster to point to (prod or a given namespace)", - Destination: &cluster, - }, - cli.StringFlag{ - Name: "app", - Value: "swarm", - Usage: "application to point to (swarm or swarm-private)", - Destination: &appName, + Name: "hosts", + Value: "", + Usage: "comma-separated list of swarm hosts", + Destination: &allhosts, }, cli.IntFlag{ - Name: "cluster-from", - Value: 8501, - Usage: "swarm node (from)", - Destination: &from, + Name: "http-port", + Value: 80, + Usage: "http port", + Destination: &httpPort, }, cli.IntFlag{ - Name: "cluster-to", - Value: 8512, - Usage: "swarm node (to)", - Destination: &to, - }, - cli.StringFlag{ - Name: "cluster-scheme", - Value: "http", - Usage: "http or https", - Destination: &scheme, - }, - cli.BoolFlag{ - Name: "include-localhost", - Usage: "whether to include localhost:8500 as an endpoint", - Destination: &includeLocalhost, + Name: "ws-port", + Value: 8546, + Usage: "ws port", + Destination: &wsPort, }, cli.IntFlag{ Name: "filesize", @@ -122,6 +103,12 @@ func main() { Usage: "whether to fetch content from a single node or from all nodes", Destination: &single, }, + cli.IntFlag{ + Name: "track-timeout", + Value: 5, + Usage: "timeout in seconds to wait for GetAllReferences to return", + Destination: &trackTimeout, + }, } app.Flags = append(app.Flags, []cli.Flag{ @@ -130,7 +117,7 @@ func main() { swarmmetrics.MetricsInfluxDBDatabaseFlag, swarmmetrics.MetricsInfluxDBUsernameFlag, swarmmetrics.MetricsInfluxDBPasswordFlag, - swarmmetrics.MetricsInfluxDBHostTagFlag, + swarmmetrics.MetricsInfluxDBTagsFlag, }...) app.Flags = append(app.Flags, tracing.Flags...) @@ -140,13 +127,25 @@ func main() { Name: "upload_and_sync", Aliases: []string{"c"}, Usage: "upload and sync", - Action: cliUploadAndSync, + Action: wrapCliCommand("upload-and-sync", uploadAndSyncCmd), }, { Name: "feed_sync", Aliases: []string{"f"}, Usage: "feed update generate, upload and sync", - Action: cliFeedUploadAndSync, + Action: wrapCliCommand("feed-and-sync", feedUploadAndSyncCmd), + }, + { + Name: "upload_speed", + Aliases: []string{"u"}, + Usage: "measure upload speed", + Action: wrapCliCommand("upload-speed", uploadSpeedCmd), + }, + { + Name: "sliding_window", + Aliases: []string{"s"}, + Usage: "measure network aggregate capacity", + Action: wrapCliCommand("sliding-window", slidingWindowCmd), }, } @@ -177,13 +176,14 @@ func emitMetrics(ctx *cli.Context) error { database = ctx.GlobalString(swarmmetrics.MetricsInfluxDBDatabaseFlag.Name) username = ctx.GlobalString(swarmmetrics.MetricsInfluxDBUsernameFlag.Name) password = ctx.GlobalString(swarmmetrics.MetricsInfluxDBPasswordFlag.Name) - hosttag = ctx.GlobalString(swarmmetrics.MetricsInfluxDBHostTagFlag.Name) + tags = ctx.GlobalString(swarmmetrics.MetricsInfluxDBTagsFlag.Name) ) - return influxdb.InfluxDBWithTagsOnce(gethmetrics.DefaultRegistry, endpoint, database, username, password, "swarm-smoke.", map[string]string{ - "host": hosttag, - "version": gitCommit, - "filesize": fmt.Sprintf("%v", filesize), - }) + + tagsMap := utils.SplitTagsFlag(tags) + tagsMap["version"] = gitCommit + tagsMap["filesize"] = fmt.Sprintf("%v", filesize) + + return influxdb.InfluxDBWithTagsOnce(gethmetrics.DefaultRegistry, endpoint, database, username, password, "swarm-smoke.", tagsMap) } return nil |