MCPcopy Create free account
hub / github.com/cosdata/cosdata / should_trigger

Method should_trigger

src/models/lru_cache.rs:120–122  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

118 }
119
120 fn should_trigger(&self) -> bool {
121 self.prob > f16::from_f32(rand::thread_rng().gen())
122 }
123
124 fn eviction_probability(&self, global_counter: u32, counter_value: u32) -> f32 {
125 let age = counter_age(global_counter, counter_value);

Callers 1

evictMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected