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

Function content_index_stats

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

536///
537/// Returns `None` if the index does not exist or cannot be opened.
538pub fn content_index_stats(repo_root: &Path) -> Option<ContentIndexStats> {
539 let config = content_config(repo_root);
540 let index = Index::open(config).ok()?;
541 let stats = index.stats();
542 Some(ContentIndexStats {
543 total_documents: stats.total_documents,
544 total_segments: stats.total_segments,
545 total_grams: stats.total_grams,
546 index_size_bytes: stats.index_size_bytes,
547 overlay_generations: stats.overlay_generations,
548 pending_edits: stats.pending_edits,
549 })
550}
551
552fn content_config(repo_root: &Path) -> Config {
553 Config {

Callers 2

runMethod · 0.85

Calls 4

content_configFunction · 0.85
openFunction · 0.85
okMethod · 0.45
statsMethod · 0.45