Skip to content

Commit

Permalink
use the right condition for triggering the miss metric
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Mar 5, 2021
1 parent 2b32c2e commit 0a2f2cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blockstore/splitstore/splitstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (s *SplitStore) Get(cid cid.Cid) (blocks.Block, error) {

case bstore.ErrNotFound:
blk, err = s.cold.Get(cid)
if err != nil {
if err == nil {
stats.Record(context.Background(), metrics.SplitstoreMiss.M(1))
}
return blk, err
Expand All @@ -229,7 +229,7 @@ func (s *SplitStore) GetSize(cid cid.Cid) (int, error) {

case bstore.ErrNotFound:
size, err = s.cold.GetSize(cid)
if err != nil {
if err == nil {
stats.Record(context.Background(), metrics.SplitstoreMiss.M(1))
}
return size, err
Expand Down

0 comments on commit 0a2f2cf

Please sign in to comment.