From 5f17a46a72cab91da185bb16ad057836369f4b97 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Thu, 7 Feb 2019 12:42:30 +0100 Subject: [PATCH] cmd/swarm/swarm-smoke: rename funcs to prefixCmd --- cmd/swarm/swarm-smoke/feed_upload_and_sync.go | 6 +++--- cmd/swarm/swarm-smoke/main.go | 8 ++++---- cmd/swarm/swarm-smoke/sliding_window.go | 6 +++--- cmd/swarm/swarm-smoke/upload_and_sync.go | 6 +++--- cmd/swarm/swarm-smoke/upload_speed.go | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cmd/swarm/swarm-smoke/feed_upload_and_sync.go b/cmd/swarm/swarm-smoke/feed_upload_and_sync.go index 95e8b2fc9e..6b3fed0c7e 100644 --- a/cmd/swarm/swarm-smoke/feed_upload_and_sync.go +++ b/cmd/swarm/swarm-smoke/feed_upload_and_sync.go @@ -26,11 +26,11 @@ const ( feedRandomDataLength = 8 ) -func feedUploadAndSync(ctx *cli.Context, tuid string) error { +func feedUploadAndSyncCmd(ctx *cli.Context, tuid string) error { errc := make(chan error) go func() { - errc <- fuas(ctx, tuid) + errc <- feedUploadAndSync(ctx, tuid) }() select { @@ -46,7 +46,7 @@ func feedUploadAndSync(ctx *cli.Context, tuid string) error { } } -func fuas(c *cli.Context, tuid string) error { +func feedUploadAndSync(c *cli.Context, tuid string) error { log.Info("generating and uploading feeds to " + httpEndpoint(hosts[0]) + " and syncing") // create a random private key to sign updates with and derive the address diff --git a/cmd/swarm/swarm-smoke/main.go b/cmd/swarm/swarm-smoke/main.go index 84c9e1f7bd..e9380813a3 100644 --- a/cmd/swarm/swarm-smoke/main.go +++ b/cmd/swarm/swarm-smoke/main.go @@ -120,25 +120,25 @@ func main() { Name: "upload_and_sync", Aliases: []string{"c"}, Usage: "upload and sync", - Action: wrapCliCommand("upload-and-sync", uploadAndSync), + Action: wrapCliCommand("upload-and-sync", uploadAndSyncCmd), }, { Name: "feed_sync", Aliases: []string{"f"}, Usage: "feed update generate, upload and sync", - Action: wrapCliCommand("feed-and-sync", feedUploadAndSync), + Action: wrapCliCommand("feed-and-sync", feedUploadAndSyncCmd), }, { Name: "upload_speed", Aliases: []string{"u"}, Usage: "measure upload speed", - Action: wrapCliCommand("upload-speed", uploadSpeed), + Action: wrapCliCommand("upload-speed", uploadSpeedCmd), }, { Name: "sliding_window", Aliases: []string{"s"}, Usage: "measure network aggregate capacity", - Action: wrapCliCommand("sliding-window", slidingWindow), + Action: wrapCliCommand("sliding-window", slidingWindowCmd), }, } diff --git a/cmd/swarm/swarm-smoke/sliding_window.go b/cmd/swarm/swarm-smoke/sliding_window.go index 876aa7b88d..d313bbc37a 100644 --- a/cmd/swarm/swarm-smoke/sliding_window.go +++ b/cmd/swarm/swarm-smoke/sliding_window.go @@ -35,11 +35,11 @@ type uploadResult struct { digest []byte } -func slidingWindow(ctx *cli.Context, tuid string) error { +func slidingWindowCmd(ctx *cli.Context, tuid string) error { errc := make(chan error) go func() { - errc <- sl(ctx, tuid) + errc <- slidingWindow(ctx, tuid) }() select { @@ -55,7 +55,7 @@ func slidingWindow(ctx *cli.Context, tuid string) error { } } -func sl(ctx *cli.Context, tuid string) error { +func slidingWindow(ctx *cli.Context, tuid string) error { hashes := []uploadResult{} //swarm hashes of the uploads nodes := len(hosts) const iterationTimeout = 30 * time.Second diff --git a/cmd/swarm/swarm-smoke/upload_and_sync.go b/cmd/swarm/swarm-smoke/upload_and_sync.go index e129802ed3..b2858e2275 100644 --- a/cmd/swarm/swarm-smoke/upload_and_sync.go +++ b/cmd/swarm/swarm-smoke/upload_and_sync.go @@ -31,13 +31,13 @@ import ( cli "gopkg.in/urfave/cli.v1" ) -func uploadAndSync(ctx *cli.Context, tuid string) error { +func uploadAndSyncCmd(ctx *cli.Context, tuid string) error { randomBytes := testutil.RandomBytes(seed, filesize*1000) errc := make(chan error) go func() { - errc <- uas(ctx, randomBytes, tuid) + errc <- uplaodAndSync(ctx, randomBytes, tuid) }() select { @@ -55,7 +55,7 @@ func uploadAndSync(ctx *cli.Context, tuid string) error { } } -func uas(c *cli.Context, randomBytes []byte, tuid string) error { +func uplaodAndSync(c *cli.Context, randomBytes []byte, tuid string) error { log.Info("uploading to "+httpEndpoint(hosts[0])+" and syncing", "tuid", tuid, "seed", seed) t1 := time.Now() diff --git a/cmd/swarm/swarm-smoke/upload_speed.go b/cmd/swarm/swarm-smoke/upload_speed.go index 1866caa730..20bf7b86ca 100644 --- a/cmd/swarm/swarm-smoke/upload_speed.go +++ b/cmd/swarm/swarm-smoke/upload_speed.go @@ -28,14 +28,14 @@ import ( cli "gopkg.in/urfave/cli.v1" ) -func uploadSpeed(ctx *cli.Context, tuid string) error { +func uploadSpeedCmd(ctx *cli.Context, tuid string) error { log.Info("uploading to "+hosts[0], "tuid", tuid, "seed", seed) randomBytes := testutil.RandomBytes(seed, filesize*1000) errc := make(chan error) go func() { - errc <- us(ctx, tuid, randomBytes) + errc <- uploadSpeed(ctx, tuid, randomBytes) }() select { @@ -53,7 +53,7 @@ func uploadSpeed(ctx *cli.Context, tuid string) error { } } -func us(c *cli.Context, tuid string, data []byte) error { +func uploadSpeed(c *cli.Context, tuid string, data []byte) error { t1 := time.Now() hash, err := upload(data, hosts[0]) if err != nil {