Skip to content

Commit

Permalink
immutable tree implement cache stat interface
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Oct 18, 2022
1 parent b1c0e30 commit 408d4b9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions immutable_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,31 @@ func (t *ImmutableTree) nodeSize() int {
})
return size
}

func (t *ImmutableTree) GetIAVLNodeCacheHitCnt() uint64 {
if t.ndb.opts.Stat == nil {
return 0
}
return t.ndb.opts.Stat.GetCacheHitCnt()
}

func (t *ImmutableTree) GetIAVLNodeCacheMissCnt() uint64 {
if t.ndb.opts.Stat == nil {
return 0
}
return t.ndb.opts.Stat.GetCacheMissCnt()
}

func (t *ImmutableTree) GetIAVLNodeFastCacheHitCnt() uint64 {
if t.ndb.opts.Stat == nil {
return 0
}
return t.ndb.opts.Stat.GetFastCacheHitCnt()
}

func (t *ImmutableTree) GetIAVLNodeFastCacheMissCnt() uint64 {
if t.ndb.opts.Stat == nil {
return 0
}
return t.ndb.opts.Stat.GetFastCacheMissCnt()
}

0 comments on commit 408d4b9

Please sign in to comment.