Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / class

IndexStats

codeintel.indexer.IndexStats

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Called by (1)
SymbolFileResolved by
indexindexer.pysame file
Contains (2)
SymbolFileResolved by
as_dictindexer.pysame file
langindexer.pysame file
Inside (1)
SymbolFileResolved by
indexerindexer.pysame file
codeintel.indexer.IndexStatsbackend/app/codeintel/indexer.py, lines 61–99Open source
@dataclassclass IndexStats:    repository: str = ""    commit_sha: str = ""    outcome: str = ""  # "indexed" | "unchanged"    embedding_model: str | None = None    files_tracked: int = 0    files_indexed: int = 0    files_unchanged: int = 0    files_deleted: int = 0    files_failed: int = 0    skipped: dict[str, int] = field(default_factory=lambda: defaultdict(int))    chunks_written: int = 0    chunks_total: int = 0    embeddings_written: int = 0    source_bytes_indexed: int = 0    lines_indexed: int = 0    languages: dict[str, LanguageStats] = field(default_factory=dict)    graph: dict = field(default_factory=dict)    timings_s: dict[str, float] = field(default_factory=lambda: defaultdict(float))    errors: list[dict[str, str]] = field(default_factory=list)    def lang(self, name: str) -> LanguageStats:        return self.languages.setdefault(name, LanguageStats())    def as_dict(self) -> dict:        # asdict() rebuilds dicts as type(d)(pairs), which fails for        # defaultdict on Python < 3.12: convert those fields first.        plain = replace(            self,            skipped=dict(self.skipped),            timings_s={k: round(v, 3) for k, v in self.timings_s.items()},            languages={                name: replace(lang, fallback_reasons=dict(lang.fallback_reasons))                for name, lang in self.languages.items()            },            errors=self.errors[:50],        )        return asdict(plain)

What the index recorded

Signature
class IndexStats:
File
backend/app/codeintel/indexer.py
Lines
61–99
Parser
python-ast
Git blob
e8fdfa7b5545e821f7649d68cfadd2aae85b89d0
Call sites
2 named, 0 resolved, 2 left unlinked

Read it on GitHub at this commit