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

Method collection_len

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

Entry count for a specific collection.

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

Source from the content-addressed store, hash-verified

118
119 /// Entry count for a specific collection.
120 pub fn collection_len(&self, tenant_id: u64, collection: &str) -> usize {
121 let tkey = table_key(tenant_id, collection);
122 self.tables.get(&tkey).map(|t| t.len()).unwrap_or(0)
123 }
124
125 /// Approximate memory usage for a specific collection. Sums the
126 /// hash table's own `mem_usage()` estimate; returns 0 if no table

Callers

nothing calls this directly

Calls 3

table_keyFunction · 0.85
getMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected