mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
cmd/swarm/swarm-smoke: more refinements
This commit is contained in:
parent
75b2b3428a
commit
983eb8c7a3
2 changed files with 6 additions and 2 deletions
|
|
@ -83,7 +83,7 @@ outer:
|
|||
uploadedBytes += filesize * 1000
|
||||
|
||||
for i, v := range hashes {
|
||||
timeout := time.After(30 * time.Second)
|
||||
timeout := time.After(time.Duration(timeout) * time.Second)
|
||||
errored = false
|
||||
|
||||
inner:
|
||||
|
|
@ -93,6 +93,7 @@ outer:
|
|||
errored = true
|
||||
log.Error("error retrieving hash. timeout", "hash idx", i, "err", err)
|
||||
metrics.GetOrRegisterCounter("sliding-window.single.error", nil).Inc(1)
|
||||
break inner
|
||||
default:
|
||||
randIndex := 1 + rand.Intn(len(endpoints)-1)
|
||||
ruid := uuid.New()[:8]
|
||||
|
|
|
|||
|
|
@ -39,11 +39,14 @@ import (
|
|||
cli "gopkg.in/urfave/cli.v1"
|
||||
)
|
||||
|
||||
var commandName = ""
|
||||
|
||||
func wrapCliCommand(name string, 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.Info("smoke test starting", "task", name, "timeout", timeout)
|
||||
commandName = name
|
||||
metrics.GetOrRegisterCounter(name, nil).Inc(1)
|
||||
|
||||
errc := make(chan error)
|
||||
|
|
@ -162,7 +165,7 @@ func fetch(hash string, endpoint string, original []byte, ruid string) error {
|
|||
opentracing.HTTPHeaders,
|
||||
opentracing.HTTPHeadersCarrier(req.Header))
|
||||
|
||||
trace := client.GetClientTrace("upload-and-sync - http get", "upload-and-sync", ruid, &tn)
|
||||
trace := client.GetClientTrace(commandName+" - http get", commandName, ruid, &tn)
|
||||
|
||||
req = req.WithContext(httptrace.WithClientTrace(ctx, trace))
|
||||
transport := http.DefaultTransport
|
||||
|
|
|
|||
Loading…
Reference in a new issue