MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / content_index_stats

Function content_index_stats

atomic-repository/src/content_search.rs:225–237  ·  view source on GitHub ↗

Return statistics about the content index. Returns `None` if the index does not exist or cannot be opened.

(repo_root: &Path)

Source from the content-addressed store, hash-verified

223///
224/// Returns `None` if the index does not exist or cannot be opened.
225pub fn content_index_stats(repo_root: &Path) -> Option<ContentIndexStats> {
226 let config = content_config(repo_root);
227 let index = Index::open(config).ok()?;
228 let stats = index.stats();
229 Some(ContentIndexStats {
230 total_documents: stats.total_documents,
231 total_segments: stats.total_segments,
232 total_grams: stats.total_grams,
233 index_size_bytes: stats.index_size_bytes,
234 overlay_generations: stats.overlay_generations,
235 pending_edits: stats.pending_edits,
236 })
237}
238
239fn content_config(repo_root: &Path) -> Config {
240 Config {

Callers 1

runMethod · 0.85

Calls 2

content_configFunction · 0.85
statsMethod · 0.45

Tested by

no test coverage detected