MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / tree_stats

Method tree_stats

graphlite/src/storage/persistent/memory.rs:172–189  ·  view source on GitHub ↗
(&self, name: &str)

Source from the content-addressed store, hash-verified

170 }
171
172 fn tree_stats(&self, name: &str) -> StorageResult<Option<TreeStatistics>> {
173 let trees = self.trees.read();
174 if let Some(tree) = trees.get(name) {
175 let data = tree.data.read();
176 let entry_count = data.len() as u64;
177 let size_bytes = data.iter().map(|(k, v)| k.len() + v.len()).sum::<usize>() as u64;
178
179 Ok(Some(TreeStatistics {
180 entry_count,
181 size_bytes,
182 memory_bytes: size_bytes, // Same as size for memory storage
183 levels: None,
184 compaction_stats: None,
185 }))
186 } else {
187 Ok(None)
188 }
189 }
190
191 fn shutdown(&mut self) -> StorageResult<()> {
192 // No-op for memory storage

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
lenMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected