diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-03-11 18:45:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-11 18:45:34 +0800 |
commit | 1a3e25e4c11d09aabd77402585412f1577251f49 (patch) | |
tree | e302704e62d65606497e6fc4d1eaf791bde5251d /cmd/swarm | |
parent | 9a58a9b91a9bb60be2768aea451576135fa7ebe0 (diff) | |
download | go-tangerine-1a3e25e4c11d09aabd77402585412f1577251f49.tar go-tangerine-1a3e25e4c11d09aabd77402585412f1577251f49.tar.gz go-tangerine-1a3e25e4c11d09aabd77402585412f1577251f49.tar.bz2 go-tangerine-1a3e25e4c11d09aabd77402585412f1577251f49.tar.lz go-tangerine-1a3e25e4c11d09aabd77402585412f1577251f49.tar.xz go-tangerine-1a3e25e4c11d09aabd77402585412f1577251f49.tar.zst go-tangerine-1a3e25e4c11d09aabd77402585412f1577251f49.zip |
swarm: tracing improvements (#19249)
Diffstat (limited to 'cmd/swarm')
-rw-r--r-- | cmd/swarm/swarm-smoke/upload_and_sync.go | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/cmd/swarm/swarm-smoke/upload_and_sync.go b/cmd/swarm/swarm-smoke/upload_and_sync.go index 50af122e7..23b7d5688 100644 --- a/cmd/swarm/swarm-smoke/upload_and_sync.go +++ b/cmd/swarm/swarm-smoke/upload_and_sync.go @@ -68,55 +68,45 @@ func uploadAndSyncCmd(ctx *cli.Context, tuid string) error { } func trackChunks(testData []byte) error { - log.Warn("Test timed out; running chunk debug sequence") + log.Warn("Test timed out, running chunk debug sequence") addrs, err := getAllRefs(testData) if err != nil { return err } - log.Trace("All references retrieved") for i, ref := range addrs { log.Trace(fmt.Sprintf("ref %d", i), "ref", ref) } - // has-chunks for _, host := range hosts { httpHost := fmt.Sprintf("ws://%s:%d", host, 8546) - log.Trace("Calling `Has` on host", "httpHost", httpHost) hostChunks := []string{} rpcClient, err := rpc.Dial(httpHost) if err != nil { - log.Trace("Error dialing host", "err", err) + log.Error("Error dialing host", "err", err) return err } - log.Trace("rpc dial ok") + var hasInfo []api.HasInfo err = rpcClient.Call(&hasInfo, "bzz_has", addrs) if err != nil { - log.Trace("Error calling host", "err", err) + log.Error("Error calling host", "err", err) return err } - log.Trace("rpc call ok") - count := 0 - for i, info := range hasInfo { - if i == 0 { - log.Trace("first hasInfo", "addr", info.Addr, "host", host, "i", i) - } - if i == len(hasInfo)-1 { - log.Trace("last hasInfo", "addr", info.Addr, "host", host, "i", i) - } + count := 0 + for _, info := range hasInfo { if info.Has { hostChunks = append(hostChunks, "1") } else { hostChunks = append(hostChunks, "0") count++ } - } + if count == 0 { log.Info("host reported to have all chunks", "host", host) } |