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

Method cold_nodes

nodedb-graph/src/csr/memory.rs:22–29  ·  view source on GitHub ↗

Get nodes with access count below `threshold` (cold nodes).

(&self, threshold: u32)

Source from the content-addressed store, hash-verified

20
21 /// Get nodes with access count below `threshold` (cold nodes).
22 pub fn cold_nodes(&self, threshold: u32) -> Vec<u32> {
23 self.access_counts
24 .iter()
25 .enumerate()
26 .filter(|(_, c)| c.get() <= threshold)
27 .map(|(i, _)| i as u32)
28 .collect()
29 }
30
31 /// Number of hot nodes (access count > 0).
32 pub fn hot_node_count(&self) -> usize {

Callers 2

access_trackingFunction · 0.80

Calls 3

collectMethod · 0.80
iterMethod · 0.45
getMethod · 0.45

Tested by 1

access_trackingFunction · 0.64