MCPcopy Create free account
hub / github.com/cocoindex-io/cocoindex-code / print_index_stats

Function print_index_stats

src/cocoindex_code/cli.py:154–167  ·  view source on GitHub ↗

Print formatted index statistics.

(status: ProjectStatusResponse)

Source from the content-addressed store, hash-verified

152
153
154def print_index_stats(status: ProjectStatusResponse) -> None:
155 """Print formatted index statistics."""
156 if status.progress is not None:
157 _typer.echo(f"Indexing in progress: {_format_progress(status.progress)}")
158 if not status.index_exists:
159 _typer.echo("\nIndex not created yet.")
160 return
161 _typer.echo("\nIndex stats:")
162 _typer.echo(f" Chunks: {status.total_chunks}")
163 _typer.echo(f" Files: {status.total_files}")
164 if status.languages:
165 _typer.echo(" Languages:")
166 for lang, count in sorted(status.languages.items(), key=lambda x: -x[1]):
167 _typer.echo(f" {lang}: {count} chunks")
168
169
170def print_search_results(response: SearchResponse) -> None:

Callers 2

indexFunction · 0.85
statusFunction · 0.85

Calls 1

_format_progressFunction · 0.85

Tested by

no test coverage detected