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

Method collection_mem_usage

nodedb/src/engine/kv/engine_stats.rs:128–134  ·  view source on GitHub ↗

Approximate memory usage for a specific collection. Sums the hash table's own `mem_usage()` estimate; returns 0 if no table exists for `(tenant_id, collection)`.

(&self, tenant_id: u64, collection: &str)

Source from the content-addressed store, hash-verified

126 /// hash table's own `mem_usage()` estimate; returns 0 if no table
127 /// exists for `(tenant_id, collection)`.
128 pub fn collection_mem_usage(&self, tenant_id: u64, collection: &str) -> u64 {
129 let tkey = table_key(tenant_id, collection);
130 self.tables
131 .get(&tkey)
132 .map(|t| t.mem_usage() as u64)
133 .unwrap_or(0)
134 }
135
136 /// Comprehensive observability snapshot for this KV engine.
137 pub fn stats(&self) -> KvStats {

Callers 1

Calls 3

table_keyFunction · 0.85
mem_usageMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected