@@ -86,9 +86,8 @@ func cliUploadAndSync(c *cli.Context) error {
86
86
func uploadAndSync (c * cli.Context ) error {
87
87
defer func (now time.Time ) {
88
88
totalTime := time .Since (now )
89
-
90
89
log .Info ("total time" , "time" , totalTime , "kb" , filesize )
91
- metrics .GetOrRegisterCounter ("upload-and-sync.total-time" , nil ).Inc ( int64 ( totalTime ) )
90
+ metrics .GetOrRegisterResettingTimer ("upload-and-sync.total-time" , nil ).Update ( totalTime )
92
91
}(time .Now ())
93
92
94
93
generateEndpoints (scheme , cluster , appName , from , to )
@@ -103,7 +102,7 @@ func uploadAndSync(c *cli.Context) error {
103
102
log .Error (err .Error ())
104
103
return err
105
104
}
106
- metrics .GetOrRegisterCounter ("upload-and-sync.upload-time" , nil ).Inc ( int64 ( time . Since ( t1 )) )
105
+ metrics .GetOrRegisterResettingTimer ("upload-and-sync.upload-time" , nil ).UpdateSince ( t1 )
107
106
108
107
fhash , err := digest (bytes .NewReader (randomBytes ))
109
108
if err != nil {
@@ -164,8 +163,6 @@ func fetch(hash string, endpoint string, original []byte, ruid string) error {
164
163
ctx , sp := spancontext .StartSpan (context .Background (), "upload-and-sync.fetch" )
165
164
defer sp .Finish ()
166
165
167
- log .Trace ("sleeping" , "ruid" , ruid )
168
- time .Sleep (3 * time .Second )
169
166
log .Trace ("http get request" , "ruid" , ruid , "api" , endpoint , "hash" , hash )
170
167
171
168
var tn time.Time
0 commit comments