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

Function content_index_stats

atomic-repository/src/content_search.rs:352–364  ·  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

350///
351/// Returns `None` if the index does not exist or cannot be opened.
352pub fn content_index_stats(repo_root: &Path) -> Option<ContentIndexStats> {
353 let config = content_config(repo_root);
354 let index = Index::open(config).ok()?;
355 let stats = index.stats();
356 Some(ContentIndexStats {
357 total_documents: stats.total_documents,
358 total_segments: stats.total_segments,
359 total_grams: stats.total_grams,
360 index_size_bytes: stats.index_size_bytes,
361 overlay_generations: stats.overlay_generations,
362 pending_edits: stats.pending_edits,
363 })
364}
365
366fn content_config(repo_root: &Path) -> Config {
367 Config {

Callers 2

runMethod · 0.85

Calls 2

content_configFunction · 0.85
statsMethod · 0.45