diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-04-26 22:41:12 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-05-10 18:26:41 +0800 |
commit | f8eb8fe64c1fa4ba85fe3e6af1f8bcdf6c936b04 (patch) | |
tree | 65afcfbbb1f3299a108978b35af2a1eb37aafa3f /swarm/network | |
parent | a1cd7e6e92b5c48989c307b6051615c4502762ca (diff) | |
download | go-tangerine-f8eb8fe64c1fa4ba85fe3e6af1f8bcdf6c936b04.tar go-tangerine-f8eb8fe64c1fa4ba85fe3e6af1f8bcdf6c936b04.tar.gz go-tangerine-f8eb8fe64c1fa4ba85fe3e6af1f8bcdf6c936b04.tar.bz2 go-tangerine-f8eb8fe64c1fa4ba85fe3e6af1f8bcdf6c936b04.tar.lz go-tangerine-f8eb8fe64c1fa4ba85fe3e6af1f8bcdf6c936b04.tar.xz go-tangerine-f8eb8fe64c1fa4ba85fe3e6af1f8bcdf6c936b04.tar.zst go-tangerine-f8eb8fe64c1fa4ba85fe3e6af1f8bcdf6c936b04.zip |
cmd/swarm-smoke: check if chunks are at most prox host
swarm/network: measure how many chunks a node delivers (#1358)
Diffstat (limited to 'swarm/network')
-rw-r--r-- | swarm/network/stream/peer.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/swarm/network/stream/peer.go b/swarm/network/stream/peer.go index 98b237ce2..2514dcad4 100644 --- a/swarm/network/stream/peer.go +++ b/swarm/network/stream/peer.go @@ -134,7 +134,7 @@ func NewPeer(peer *protocols.Peer, streamer *Registry) *Peer { func (p *Peer) Deliver(ctx context.Context, chunk storage.Chunk, priority uint8, syncing bool) error { var msg interface{} - spanName := "send.chunk.delivery" + metrics.GetOrRegisterCounter("peer.deliver", nil).Inc(1) //we send different types of messages if delivery is for syncing or retrievals, //even if handling and content of the message are the same, @@ -144,16 +144,13 @@ func (p *Peer) Deliver(ctx context.Context, chunk storage.Chunk, priority uint8, Addr: chunk.Address(), SData: chunk.Data(), } - spanName += ".syncing" } else { msg = &ChunkDeliveryMsgRetrieval{ Addr: chunk.Address(), SData: chunk.Data(), } - spanName += ".retrieval" } - ctx = context.WithValue(ctx, "stream_send_tag", nil) return p.SendPriority(ctx, msg, priority) } |