aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/swarm
diff options
context:
space:
mode:
authorholisticode <holistic.computing@gmail.com>2019-01-19 01:14:06 +0800
committerRafael Matias <rafael@skyle.net>2019-02-19 19:56:30 +0800
commit4625b1257f614646cdac49fcc0a76f2a1d58fb5c (patch)
tree8f627238dacb53fab54872a5a7991ca7a186895a /cmd/swarm
parent21d54bcaac6c43b92e9bf86610d0952de454f2df (diff)
downloadgo-tangerine-4625b1257f614646cdac49fcc0a76f2a1d58fb5c.tar
go-tangerine-4625b1257f614646cdac49fcc0a76f2a1d58fb5c.tar.gz
go-tangerine-4625b1257f614646cdac49fcc0a76f2a1d58fb5c.tar.bz2
go-tangerine-4625b1257f614646cdac49fcc0a76f2a1d58fb5c.tar.lz
go-tangerine-4625b1257f614646cdac49fcc0a76f2a1d58fb5c.tar.xz
go-tangerine-4625b1257f614646cdac49fcc0a76f2a1d58fb5c.tar.zst
go-tangerine-4625b1257f614646cdac49fcc0a76f2a1d58fb5c.zip
cmd/swarm/swarm-smoke: use ResettingTimer instead of Counters for times (#18479)
(cherry picked from commit 560957799a089042e471320d179ef2e96caf4f8d)
Diffstat (limited to 'cmd/swarm')
-rw-r--r--cmd/swarm/swarm-smoke/upload_and_sync.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/cmd/swarm/swarm-smoke/upload_and_sync.go b/cmd/swarm/swarm-smoke/upload_and_sync.go
index d605f79a3..6b26b152d 100644
--- a/cmd/swarm/swarm-smoke/upload_and_sync.go
+++ b/cmd/swarm/swarm-smoke/upload_and_sync.go
@@ -86,9 +86,8 @@ func cliUploadAndSync(c *cli.Context) error {
func uploadAndSync(c *cli.Context) error {
defer func(now time.Time) {
totalTime := time.Since(now)
-
log.Info("total time", "time", totalTime, "kb", filesize)
- metrics.GetOrRegisterCounter("upload-and-sync.total-time", nil).Inc(int64(totalTime))
+ metrics.GetOrRegisterResettingTimer("upload-and-sync.total-time", nil).Update(totalTime)
}(time.Now())
generateEndpoints(scheme, cluster, appName, from, to)
@@ -103,7 +102,7 @@ func uploadAndSync(c *cli.Context) error {
log.Error(err.Error())
return err
}
- metrics.GetOrRegisterCounter("upload-and-sync.upload-time", nil).Inc(int64(time.Since(t1)))
+ metrics.GetOrRegisterResettingTimer("upload-and-sync.upload-time", nil).UpdateSince(t1)
fhash, err := digest(bytes.NewReader(randomBytes))
if err != nil {
@@ -166,8 +165,6 @@ func fetch(hash string, endpoint string, original []byte, ruid string) error {
ctx, sp := spancontext.StartSpan(context.Background(), "upload-and-sync.fetch")
defer sp.Finish()
- log.Trace("sleeping", "ruid", ruid)
- time.Sleep(3 * time.Second)
log.Trace("http get request", "ruid", ruid, "api", endpoint, "hash", hash)
var tn time.Time