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

Function content_index_stats

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

334///
335/// Returns `None` if the index does not exist or cannot be opened.
336pub fn content_index_stats(repo_root: &Path) -> Option<ContentIndexStats> {
337 let config = content_config(repo_root);
338 let index = Index::open(config).ok()?;
339 let stats = index.stats();
340 Some(ContentIndexStats {
341 total_documents: stats.total_documents,
342 total_segments: stats.total_segments,
343 total_grams: stats.total_grams,
344 index_size_bytes: stats.index_size_bytes,
345 overlay_generations: stats.overlay_generations,
346 pending_edits: stats.pending_edits,
347 })
348}
349
350fn content_config(repo_root: &Path) -> Config {
351 Config {

Callers 2

runMethod · 0.85

Calls 2

content_configFunction · 0.85
statsMethod · 0.45