MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / overshoot_score

Method overshoot_score

nodedb/src/engine/sparse/doc_cache.rs:60–64  ·  view source on GitHub ↗

Eviction pressure score: `current_entries * total_weight / weight`. Higher = more over-proportional → should be evicted from first.

(&self, total_weight: u64)

Source from the content-addressed store, hash-verified

58 /// Eviction pressure score: `current_entries * total_weight / weight`.
59 /// Higher = more over-proportional → should be evicted from first.
60 fn overshoot_score(&self, total_weight: u64) -> u64 {
61 (self.entries.len() as u64)
62 .saturating_mul(total_weight)
63 .saturating_div(self.weight as u64)
64 }
65
66 /// Evict the oldest (FIFO) entry from this shard. Returns `true` if an
67 /// entry was removed.

Callers 1

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected