Skip to content

Commit 355d55b

Browse files
nonsenseskylenet
authored andcommitted
cmd/swarm/swarm-smoke: remove wrong metrics (ethereum#18970)
(cherry picked from commit c5c9cef)
1 parent 7038b57 commit 355d55b

File tree

4 files changed

+4
-24
lines changed

4 files changed

+4
-24
lines changed

cmd/swarm/swarm-smoke/sliding_window.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ type uploadResult struct {
4343
}
4444

4545
func slidingWindow(c *cli.Context) error {
46-
defer func(now time.Time) {
47-
totalTime := time.Since(now)
48-
49-
log.Info("total time", "time", totalTime)
50-
metrics.GetOrRegisterCounter("sliding-window.total-time", nil).Inc(int64(totalTime))
51-
}(time.Now())
52-
5346
generateEndpoints(scheme, cluster, appName, from, to)
5447
hashes := []uploadResult{} //swarm hashes of the uploads
5548
nodes := to - from

cmd/swarm/swarm-smoke/upload_and_sync.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ import (
3333
)
3434

3535
func uploadAndSync(c *cli.Context) error {
36-
defer func(now time.Time) {
37-
totalTime := time.Since(now)
38-
log.Info("total time", "time", totalTime, "kb", filesize)
39-
metrics.GetOrRegisterResettingTimer("upload-and-sync.total-time", nil).Update(totalTime)
40-
}(time.Now())
41-
4236
generateEndpoints(scheme, cluster, appName, from, to)
4337
seed := int(time.Now().UnixNano() / 1e6)
4438

cmd/swarm/swarm-smoke/upload_speed.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ import (
3030
)
3131

3232
func uploadSpeed(c *cli.Context) error {
33-
defer func(now time.Time) {
34-
totalTime := time.Since(now)
35-
36-
log.Info("total time", "time", totalTime, "kb", filesize)
37-
metrics.GetOrRegisterCounter("upload-speed.total-time", nil).Inc(int64(totalTime))
38-
}(time.Now())
39-
4033
endpoint := generateEndpoint(scheme, cluster, appName, from)
4134
seed := int(time.Now().UnixNano() / 1e6)
4235
log.Info("uploading to "+endpoint, "seed", seed)

cmd/swarm/swarm-smoke/util.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ var (
4646
func wrapCliCommand(name string, killOnTimeout bool, command func(*cli.Context) error) func(*cli.Context) error {
4747
return func(ctx *cli.Context) error {
4848
log.PrintOrigins(true)
49-
log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(verbosity), log.StreamHandler(os.Stdout, log.TerminalFormat(true))))
49+
log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(verbosity), log.StreamHandler(os.Stdout, log.TerminalFormat(false))))
50+
5051
defer func(now time.Time) {
5152
totalTime := time.Since(now)
52-
53-
log.Info("total time", "time", totalTime)
54-
metrics.GetOrRegisterCounter(name+".total-time", nil).Inc(int64(totalTime))
53+
log.Info("total time", "time", totalTime, "kb", filesize)
54+
metrics.GetOrRegisterResettingTimer(name+".total-time", nil).Update(totalTime)
5555
}(time.Now())
5656

5757
log.Info("smoke test starting", "task", name, "timeout", timeout)

0 commit comments

Comments
 (0)