synth

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func RepoName

func RepoName(i int) string

RepoName is the name of the i-th repository, counting from zero.

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.

func Default

func Default() Config

Default is the organization of the scale check: 300 repositories, about 1,500 changes a week over the whole organization, and 26 weeks.

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

func New(c Config) *Source

New makes the source of a configuration. Values below one are raised to one, except ChangesPerWeek, which may be zero.

func (*Source) CIRuns

func (s *Source) CIRuns(sc measure.Scope, w measure.Window, fn func(*record.CIRun)) error

CIRuns reads the runs created inside the window.

func (*Source) Changes

func (s *Source) Changes(sc measure.Scope, w measure.Window, fn func(*record.Change)) error

Changes reads the changes opened inside the window.

func (*Source) Config

func (s *Source) Config() Config

Config is the configuration the source was made with, after defaults.

func (*Source) Deploys

func (s *Source) Deploys(sc measure.Scope, w measure.Window, fn func(*record.Deploy)) error

Deploys reads the deploys created inside the window.

func (*Source) End

func (s *Source) End() time.Time

End is the end of the history: the time the last read of every repository finished.

func (s *Source) Links(sc measure.Scope, _ measure.Window, fn func(*record.Link)) error

Links reads the revert links of a repository. A link has no time, so the window does not cut them, as in the store.

func (*Source) Scopes

func (s *Source) Scopes() []measure.Scope

Scopes lists the repositories, in order.

func (*Source) Tickets

func (s *Source) Tickets(measure.Scope, measure.Window, func(*record.Ticket)) error

Tickets reads nothing: the organization has no ticket source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL