snapshot

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 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 snapshot builds shareable mirror copies for demos and benchmarks. See specs/000-product/contracts/sync.md "Snapshot generation".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseWindow

func ParseWindow(s string) (time.Duration, error)

ParseWindow parses a human window like "90d", "12w", "720h", or any time.ParseDuration string. Empty returns (0, nil).

Types

type FlowStats added in v0.22.0

type FlowStats struct {
	WIPCount                        int
	WIPAgeP50, WIPAgeP85, WIPAgeMax float64
	CycleCount                      int
	CycleP50, CycleP85, CycleMax    float64
	Closed, ClosedThroughProgress   int
}

FlowStats is the distribution `gadak snapshot` reports about the file it just wrote. Ages and cycles are days.

func (FlowStats) String added in v0.22.0

func (f FlowStats) String() string

String is the one line the command prints.

type Options

type Options struct {
	From   string
	Out    string
	Spread time.Duration // 0 = keep source timestamps
	Scale  int           // target issue count; ≤ source count means no cloning
	Seed   int64         // reserved for determinism; algorithm itself is seed-stable
	Force  bool
	Now    time.Time
	// DeriveSprints invents a sprint history from fix versions named
	// "Sprint N" (the demo fixture's convention) when the source has no
	// sprints of its own — see deriveSprints (GDK-1656).
	DeriveSprints bool
}

Options controls snapshot generation. Now is injectable for deterministic tests.

type Result

type Result struct {
	Path      string
	Issues    int
	Comments  int
	Changelog int
	Spread    time.Duration
	Scale     int
	Bytes     int64
	// Facet rotation (GDK-1558), zero when nothing was cloned: the size of the
	// two value pools the clones rotate through and the length of the weighted
	// sequence (one entry per source issue). Reported so "did the rotation
	// happen, and over what" is answered by the command that did it.
	Assignees   int
	Priorities  int
	SequenceLen int
	// Flow is what the snapshot's own timestamps say about how work moves
	// through it (GDK-1739). Always measured, always printed: the defect this
	// answers — a fixture whose WIP was two months old and whose cycle time
	// was an afternoon — took a hand-written SQL probe to see, on a file that
	// is regenerated by a Makefile target nobody watches.
	Flow FlowStats
}

Result is the human-readable summary of a successful Build.

func Build

func Build(opts Options) (Result, error)

Build creates a new shareable database at opts.Out from opts.From. Output is written via a temp file and renamed only after a credential scan.

Jump to

Keyboard shortcuts

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