···742742 Stats RepoStats
743743}
744744745745+// MinimalRepoListEntry is a subset of RepoListEntry. It was added after
746746+// performance profiling of sourcegraph.com revealed that querying this
747747+// information from Zoekt was causing lots of CPU and memory usage. Note: we
748748+// can revisit this, how we store and query this information has changed a lot
749749+// since this was introduced.
745750type MinimalRepoListEntry struct {
751751+ // HasSymbols is exported since Sourcegraph uses this information at search
752752+ // planning time to decide between Zoekt and an unindexed symbol search.
753753+ //
754754+ // Note: it pretty much is always true in practice.
746755 HasSymbols bool
747747- Branches []RepositoryBranch
756756+757757+ // Branches is used by Sourcegraphs query planner to decided if it can use
758758+ // zoekt or go via an unindexed code path.
759759+ Branches []RepositoryBranch
760760+761761+ // IndexTimeUnix is the IndexTime converted to unix time (number of seconds
762762+ // since the epoch). This is to make it clear we are not transporting the
763763+ // full fidelty timestamp (ie with milliseconds and location). Additionally
764764+ // it saves 16 bytes in this struct.
765765+ //
766766+ // IndexTime is used as a heuristic in Sourcegraph to decide in aggregate
767767+ // how many repositories need updating after a ranking change/etc.
768768+ //
769769+ // TODO(keegancsmith) audit updates to IndexTime and document how and when
770770+ // it changes. Concerned about things like metadata updates or compound
771771+ // shards leading to untrustworthy data here.
772772+ IndexTimeUnix int64
748773}
749774750775type ReposMap map[uint32]MinimalRepoListEntry