···1212 "sort"
1313 "strings"
1414 "sync"
1515+ "sync/atomic"
1516 "time"
16171718 "github.com/bluesky-social/indigo/models"
···165166 return count > 0, nil
166167}
167168169169+var CacheHits int64
170170+var CacheMiss int64
171171+168172func (uv *userView) Get(ctx context.Context, k cid.Cid) (blockformat.Block, error) {
169173 if !k.Defined() {
170174 return nil, fmt.Errorf("attempted to 'get' undefined cid")
···172176 if uv.cache != nil {
173177 blk, ok := uv.cache[k]
174178 if ok {
179179+ atomic.AddInt64(&CacheHits, 1)
180180+175181 return blk, nil
176182 }
177183 }
184184+ atomic.AddInt64(&CacheMiss, 1)
178185179186 // TODO: for now, im using a join to ensure we only query blocks from the
180187 // correct user. maybe it makes sense to put the user in the blockRef