Print formatted index statistics.
(status: ProjectStatusResponse)
| 152 | |
| 153 | |
| 154 | def 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 | |
| 170 | def print_search_results(response: SearchResponse) -> None: |
no test coverage detected