aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorAnton Evangelatov <anton.evangelatov@gmail.com>2019-01-30 21:02:15 +0800
committerRafael Matias <rafael@skyle.net>2019-02-19 20:05:37 +0800
commit355d55bd349e7ca6360f626279858c31cfc59898 (patch)
tree734fd197b36a10ee5cc4fb9eb90d2b80ae8990ab /cmd
parent7038b5734c9068fb67851b9a21d771ae93aef1fd (diff)
downloaddexon-355d55bd349e7ca6360f626279858c31cfc59898.tar.gz
dexon-355d55bd349e7ca6360f626279858c31cfc59898.tar.zst
dexon-355d55bd349e7ca6360f626279858c31cfc59898.zip
cmd/swarm/swarm-smoke: remove wrong metrics (#18970)
(cherry picked from commit c5c9cef5c0baf1652b6642858ad2426794823699)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/swarm/swarm-smoke/sliding_window.go7
-rw-r--r--cmd/swarm/swarm-smoke/upload_and_sync.go6
-rw-r--r--cmd/swarm/swarm-smoke/upload_speed.go7
-rw-r--r--cmd/swarm/swarm-smoke/util.go8
4 files changed, 4 insertions, 24 deletions
diff --git a/cmd/swarm/swarm-smoke/sliding_window.go b/cmd/swarm/swarm-smoke/sliding_window.go
index 3dd404c50..3c4b1c79a 100644
--- a/cmd/swarm/swarm-smoke/sliding_window.go
+++ b/cmd/swarm/swarm-smoke/sliding_window.go
@@ -43,13 +43,6 @@ type uploadResult struct {
}
func slidingWindow(c *cli.Context) error {
- defer func(now time.Time) {
- totalTime := time.Since(now)
-
- log.Info("total time", "time", totalTime)
- metrics.GetOrRegisterCounter("sliding-window.total-time", nil).Inc(int64(totalTime))
- }(time.Now())
-
generateEndpoints(scheme, cluster, appName, from, to)
hashes := []uploadResult{} //swarm hashes of the uploads
nodes := to - from
diff --git a/cmd/swarm/swarm-smoke/upload_and_sync.go b/cmd/swarm/swarm-smoke/upload_and_sync.go
index b0e1f3ee4..c67989651 100644
--- a/cmd/swarm/swarm-smoke/upload_and_sync.go
+++ b/cmd/swarm/swarm-smoke/upload_and_sync.go
@@ -33,12 +33,6 @@ import (
)
func uploadAndSync(c *cli.Context) error {
- defer func(now time.Time) {
- totalTime := time.Since(now)
- log.Info("total time", "time", totalTime, "kb", filesize)
- metrics.GetOrRegisterResettingTimer("upload-and-sync.total-time", nil).Update(totalTime)
- }(time.Now())
-
generateEndpoints(scheme, cluster, appName, from, to)
seed := int(time.Now().UnixNano() / 1e6)
diff --git a/cmd/swarm/swarm-smoke/upload_speed.go b/cmd/swarm/swarm-smoke/upload_speed.go
index 943c93240..1123f2449 100644
--- a/cmd/swarm/swarm-smoke/upload_speed.go
+++ b/cmd/swarm/swarm-smoke/upload_speed.go
@@ -30,13 +30,6 @@ import (
)
func uploadSpeed(c *cli.Context) error {
- defer func(now time.Time) {
- totalTime := time.Since(now)
-
- log.Info("total time", "time", totalTime, "kb", filesize)
- metrics.GetOrRegisterCounter("upload-speed.total-time", nil).Inc(int64(totalTime))
- }(time.Now())
-
endpoint := generateEndpoint(scheme, cluster, appName, from)
seed := int(time.Now().UnixNano() / 1e6)
log.Info("uploading to "+endpoint, "seed", seed)
diff --git a/cmd/swarm/swarm-smoke/util.go b/cmd/swarm/swarm-smoke/util.go
index 2a3083bf5..003973d41 100644
--- a/cmd/swarm/swarm-smoke/util.go
+++ b/cmd/swarm/swarm-smoke/util.go
@@ -46,12 +46,12 @@ var (
func wrapCliCommand(name string, killOnTimeout bool, command func(*cli.Context) error) func(*cli.Context) error {
return func(ctx *cli.Context) error {
log.PrintOrigins(true)
- log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(verbosity), log.StreamHandler(os.Stdout, log.TerminalFormat(true))))
+ log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(verbosity), log.StreamHandler(os.Stdout, log.TerminalFormat(false))))
+
defer func(now time.Time) {
totalTime := time.Since(now)
-
- log.Info("total time", "time", totalTime)
- metrics.GetOrRegisterCounter(name+".total-time", nil).Inc(int64(totalTime))
+ log.Info("total time", "time", totalTime, "kb", filesize)
+ metrics.GetOrRegisterResettingTimer(name+".total-time", nil).Update(totalTime)
}(time.Now())
log.Info("smoke test starting", "task", name, "timeout", timeout)