Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShardedAdmitter ¶ added in v1.5.0
type ShardedAdmitter struct {
// contains filtered or unexported fields
}
func NewShardedAdmitter ¶ added in v1.5.0
func NewShardedAdmitter(cfg *config.Admission) *ShardedAdmitter
NewShardedAdmitter (legacy) builds an admitter from an explicit Config. Kept for backward compatibility with existing code/tests.
func (*ShardedAdmitter) Allow ¶ added in v1.5.0
func (a *ShardedAdmitter) Allow(candidate, victim uint64) bool
Allow returns true if the candidate should replace a victim according to TinyLFU. If the candidate is unseen by the doorkeeper we conservatively reject (unless caller uses a small “window” segment to bypass admission).
func (*ShardedAdmitter) Estimate ¶ added in v1.5.0
func (a *ShardedAdmitter) Estimate(h uint64) uint8
Estimate exposes freq estimate (for metrics/diagnostics).
func (*ShardedAdmitter) Record ¶ added in v1.5.0
func (a *ShardedAdmitter) Record(h uint64)
Record observes a key access. We use the doorkeeper to gate noise: first sight -> set bit only. Second (or FP) sight -> increment TinyLFU sketch (approximate frequency).
func (*ShardedAdmitter) Reset ¶ added in v1.5.0
func (a *ShardedAdmitter) Reset()
Reset forces aging now (useful for tests or ops hooks). Also resets the doorkeeper.