Documentation
¶
Overview ¶
Package synth is a seeded, synthetic organization that serves records through the measure.Source interface. It holds no real data: every name is invented, and the same Config always gives the same records in the same order.
The organization is made for tests, benchmarks and scale checks of code that builds a line from records. It covers the shapes a builder has to handle: changes that merged, were closed unmerged, are open, or are drafts; reviews by people and by agents; commits including merge commits and fixes pushed after the first review; CI runs with and without a runner wait, re-runs and merge queue runs; production deploys by deployment record and by release; reverts; and authors that are people, coding agents and automation.
A repository is generated from its own seeded random stream, so its records do not depend on any other repository, and only one repository is held in memory at a time.
Index ¶
- func RepoName(i int) string
- type Config
- type Source
- func (s *Source) CIRuns(sc measure.Scope, w measure.Window, fn func(*record.CIRun)) error
- func (s *Source) Changes(sc measure.Scope, w measure.Window, fn func(*record.Change)) error
- func (s *Source) Config() Config
- func (s *Source) Deploys(sc measure.Scope, w measure.Window, fn func(*record.Deploy)) error
- func (s *Source) End() time.Time
- func (s *Source) Links(sc measure.Scope, _ measure.Window, fn func(*record.Link)) error
- func (s *Source) Scopes() []measure.Scope
- func (s *Source) Tickets(measure.Scope, measure.Window, func(*record.Ticket)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Seed picks the organization. The same Config gives the same records.
Seed int64
// Repos is how many repositories the organization has.
Repos int
// ChangesPerWeek is about how many changes the whole organization opens
// in a week. Each repository gets its own share, so repositories differ.
ChangesPerWeek int
// Weeks is how many weeks of history the organization has.
Weeks int
// Start is when the history begins. A zero Start means 5 January 2026.
Start time.Time
}
Config sizes a synthetic organization.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is the synthetic organization. It implements measure.Source. It is safe for concurrent use.
func New ¶
New makes the source of a configuration. Values below one are raised to one, except ChangesPerWeek, which may be zero.
func (*Source) End ¶
End is the end of the history: the time the last read of every repository finished.
func (*Source) Links ¶
Links reads the revert links of a repository. A link has no time, so the window does not cut them, as in the store.