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

Method record_access

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

Record a node access (called during traversals for hot/cold tracking).

(&self, node_id: u32)

Source from the content-addressed store, hash-verified

11impl CsrIndex {
12 /// Record a node access (called during traversals for hot/cold tracking).
13 pub fn record_access(&self, node_id: u32) {
14 let idx = node_id as usize;
15 if idx < self.access_counts.len() {
16 let c = &self.access_counts[idx];
17 c.set(c.get().saturating_add(1));
18 }
19 }
20
21 /// Get nodes with access count below `threshold` (cold nodes).
22 pub fn cold_nodes(&self, threshold: u32) -> Vec<u32> {

Callers 6

traverse_bfsMethod · 0.80
shortest_pathMethod · 0.80
subgraphMethod · 0.80
access_trackingFunction · 0.80
neighborsMethod · 0.80
neighbors_multiMethod · 0.80

Calls 3

lenMethod · 0.45
setMethod · 0.45
getMethod · 0.45

Tested by 1

access_trackingFunction · 0.64