Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/swarm/swarm-smoke: remove wrong metrics #18970

Merged
merged 1 commit into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions cmd/swarm/swarm-smoke/sliding_window.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions cmd/swarm/swarm-smoke/upload_and_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
7 changes: 0 additions & 7 deletions cmd/swarm/swarm-smoke/upload_speed.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions cmd/swarm/swarm-smoke/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down