buildstats

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstrumentHTTPClient

func InstrumentHTTPClient(client *http.Client) *http.Client

InstrumentHTTPClient wraps an HTTP client so active builds can estimate network wait time.

func RecordPlugin

func RecordPlugin(stage, plugin string, duration time.Duration)

RecordPlugin stores a plugin hook timing when a profile is active.

func RecordStage

func RecordStage(stage string, duration time.Duration)

RecordStage stores a stage timing when a profile is active.

func SetActiveStage

func SetActiveStage(stage string)

SetActiveStage marks the currently running lifecycle stage for resource attribution.

Types

type Hotspot

type Hotspot struct {
	Stage    string
	Plugin   string
	Duration time.Duration
}

Hotspot identifies a slow plugin hook.

type Profile

type Profile struct {
	// contains filtered or unexported fields
}

Profile collects coarse-grained benchmark data for a build.

func Start

func Start() *Profile

Start begins collecting benchmark data for the current process.

func (*Profile) Stop

func (p *Profile) Stop() Summary

Stop finishes collection and returns a stable summary.

type ResourceBreakdown

type ResourceBreakdown struct {
	CPU         time.Duration
	NetworkWait time.Duration
	DiskWait    time.Duration
	Idle        time.Duration
}

ResourceBreakdown is an estimated wall-time split for a build.

type StageTiming

type StageTiming struct {
	Stage     string
	Duration  time.Duration
	Resources ResourceBreakdown
}

StageTiming records how long a lifecycle stage took.

type Summary

type Summary struct {
	Total     time.Duration
	Resources ResourceBreakdown
	Hotspots  []Hotspot
	Stages    []StageTiming
}

Summary contains benchmark details for a single build.

Jump to

Keyboard shortcuts

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