coreos / torus

Torus Distributed Storage
https://coreos.com/blog/torus-distributed-storage-by-coreos.html
Apache License 2.0
1.77k stars 172 forks source link

prometheus: move promDistBlockPeerFailures to readFromPeer() #425

Open nak3 opened 7 years ago

nak3 commented 7 years ago

prometheus: move promDistBlockPeerFailures to readFromPeer()

ReadLevel doesn't increment the promDistBlockPeerFailures when we set ReadSpread in current code. Since GetBlock() for remote peers are called in readFromPeer, this patch moves promDistBlockPeerFailures incrementation to readFromPeer()

xiang90 commented 7 years ago

Can you explain briefly why you want to make this change? Also we actually might increase the counter in getblock func. Moving the accounting to the caller might double count if you do not change getblock.

nak3 commented 7 years ago

Sure, I explained it in the first comment.