metrics: increment misses in View().

This commit is contained in:
Raúl Kripalani 2021-03-16 20:05:22 +00:00 committed by vyzo
parent 3a9b7c592d
commit b2b7eb2ded

View File

@ -310,7 +310,11 @@ func (s *SplitStore) View(cid cid.Cid, cb func([]byte) error) error {
err := s.hot.View(cid, cb) err := s.hot.View(cid, cb)
switch err { switch err {
case bstore.ErrNotFound: case bstore.ErrNotFound:
return s.cold.View(cid, cb) err = s.cold.View(cid, cb)
if err == nil {
stats.Record(context.Background(), metrics.SplitstoreMiss.M(1))
}
return err
default: default:
return err return err