From 0a2f2cf00df7b812c66603535e1410a22766af7b Mon Sep 17 00:00:00 2001 From: vyzo Date: Fri, 5 Mar 2021 12:04:40 +0200 Subject: [PATCH] use the right condition for triggering the miss metric --- blockstore/splitstore/splitstore.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index 6a18e898e..559c26264 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -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 @@ -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