cmd/swarm-smoke: check if chunks are at most prox host

swarm/network: measure how many chunks a node delivers (#1358)
This commit is contained in:
Anton Evangelatov
2019-04-26 16:41:12 +02:00
parent a1cd7e6e92
commit f8eb8fe64c
2 changed files with 101 additions and 7 deletions

View File

@ -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)
}