swarm/network: add metrics around send.offered.hashes

This commit is contained in:
Anton Evangelatov 2019-03-11 10:23:36 +01:00
parent 867fed2d94
commit 2cfd8f0d8e
2 changed files with 3 additions and 1 deletions

View file

@ -98,7 +98,7 @@ func trackChunks(testData []byte) error {
} }
count := 0 count := 0
for i, info := range hasInfo { for _, info := range hasInfo {
if info.Has { if info.Has {
hostChunks = append(hostChunks, "1") hostChunks = append(hostChunks, "1")
} else { } else {

View file

@ -183,6 +183,8 @@ func (p *Peer) SendOfferedHashes(s *server, f, t uint64) error {
) )
defer sp.Finish() defer sp.Finish()
defer metrics.GetOrRegisterResettingTimer("send.offered.hashes", nil).UpdateSince(time.Now())
hashes, from, to, proof, err := s.setNextBatch(f, t) hashes, from, to, proof, err := s.setNextBatch(f, t)
if err != nil { if err != nil {
return err return err