Skip to content

Commit

Permalink
Merge pull request ethereum#506 from ethersphere/lazychunkreader_coun…
Browse files Browse the repository at this point in the history
…ters

swarm/storage: counters for errors and bytes for LazyChunkReader
  • Loading branch information
nonsense committed May 7, 2018
2 parents 9ed58a2 + fc42707 commit 9ce4fef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions swarm/storage/chunker.go
Expand Up @@ -545,8 +545,11 @@ func (self *LazyChunkReader) Read(b []byte) (read int, err error) {
read, err = self.ReadAt(b, self.off)
if err != nil && err != io.EOF {
log.Error("lazychunkreader.readat", "read", read, "err", err)
metrics.GetOrRegisterCounter("lazychunkreader.read.err", nil).Inc(1)
}

metrics.GetOrRegisterCounter("lazychunkreader.read.bytes", nil).Inc(int64(read))

self.off += int64(read)
return
}
Expand Down

0 comments on commit 9ce4fef

Please sign in to comment.