Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
56095779
Commit
56095779
authored
Jan 18, 2019
by
holisticode
Committed by
Anton Evangelatov
Jan 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/swarm/swarm-smoke: use ResettingTimer instead of Counters for times (#18479)
parent
a0b0db63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
upload_and_sync.go
cmd/swarm/swarm-smoke/upload_and_sync.go
+2
-5
No files found.
cmd/swarm/swarm-smoke/upload_and_sync.go
View file @
56095779
...
...
@@ -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
.
GetOrRegister
Counter
(
"upload-and-sync.total-time"
,
nil
)
.
Inc
(
int64
(
totalTime
)
)
metrics
.
GetOrRegister
ResettingTimer
(
"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
.
GetOrRegister
Counter
(
"upload-and-sync.upload-time"
,
nil
)
.
Inc
(
int64
(
time
.
Since
(
t1
))
)
metrics
.
GetOrRegister
ResettingTimer
(
"upload-and-sync.upload-time"
,
nil
)
.
UpdateSince
(
t1
)
fhash
,
err
:=
digest
(
bytes
.
NewReader
(
randomBytes
))
if
err
!=
nil
{
...
...
@@ -164,8 +163,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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment