analyzer

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchInfo

type BranchInfo struct {
	Name      string  `json:"name"`
	Commit    string  `json:"commit"`
	SizeMB    float64 `json:"size_mb"`
	Layers    int     `json:"layers"`
	BuildTime float64 `json:"build_time"`
}

BranchInfo holds information about a branch's Docker image

type BuildResult

type BuildResult struct {
	CommitHash    string      `json:"commit_hash"`
	CommitMessage string      `json:"commit_message"`
	Author        string      `json:"author"`
	Date          time.Time   `json:"date"`
	ImageSize     int64       `json:"image_size"`
	BuildTime     float64     `json:"build_time_seconds"`
	LayerCount    int         `json:"layer_count"`
	Layers        []LayerInfo `json:"layers,omitempty"`
	Error         string      `json:"error,omitempty"`
	SizeDiff      int64       `json:"size_diff,omitempty"`
}

BuildResult represents the result of building a Docker image at a specific commit

type CompareResult added in v0.1.2

type CompareResult struct {
	BranchA              BranchInfo `json:"branch_a"`
	BranchB              BranchInfo `json:"branch_b"`
	SizeDiff             float64    `json:"size_diff_mb"`
	SizeDiffPercent      float64    `json:"size_diff_percent"`
	LayersDiff           int        `json:"layers_diff"`
	BuildTimeDiff        float64    `json:"build_time_diff"`
	BuildTimeDiffPercent float64    `json:"build_time_diff_percent"`
}

CompareResult holds the comparison results

type Comparer

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

Comparer compares Docker images between branches

func NewComparer

func NewComparer(config ComparerConfig) (*Comparer, error)

NewComparer creates a new Comparer

func (*Comparer) Compare

func (c *Comparer) Compare(ctx context.Context, branchA, branchB string) (*CompareResult, error)

Compare compares Docker images between two branches

type ComparerConfig

type ComparerConfig struct {
	RepoPath       string
	DockerfilePath string
	Verbose        bool
}

ComparerConfig holds configuration for the Comparer

type Config

type Config struct {
	RepoPath       string
	DockerfilePath string
	MaxCommits     int
	Branch         string
	Since          string
	Until          string
	SkipFailed     bool
	Verbose        bool
}

Config holds configuration for the TimeMachine

type JSONReport added in v0.2.0

type JSONReport struct {
	Results         []BuildResult     `json:"results"`
	LayerComparison []LayerComparison `json:"layer_comparison"`
	CommitOrder     []string          `json:"commit_order"`
}

JSONReport is the structure for JSON output

type LayerComparison added in v0.2.0

type LayerComparison struct {
	LayerCommand string             `json:"layer_command"`
	SizeByCommit map[string]float64 `json:"size_by_commit"` // commit hash -> size in MB
}

LayerComparison represents layer sizes across commits

type LayerInfo added in v0.2.0

type LayerInfo struct {
	ID        string  `json:"id,omitempty"`
	CreatedBy string  `json:"created_by"`
	Size      int64   `json:"size"`
	SizeMB    float64 `json:"size_mb"`
}

LayerInfo represents information about a single Docker image layer

type TimeMachine

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

TimeMachine is the main analyzer

func NewTimeMachine

func NewTimeMachine(config Config) (*TimeMachine, error)

NewTimeMachine creates a new TimeMachine instance

func (*TimeMachine) AnalyzeCommit

func (tm *TimeMachine) AnalyzeCommit(ctx context.Context, commit *object.Commit) BuildResult

AnalyzeCommit is exported for use by bisect package

func (*TimeMachine) GenerateReport

func (tm *TimeMachine) GenerateReport(format string, writer io.Writer) error

GenerateReport generates output in the specified format

func (*TimeMachine) Run

func (tm *TimeMachine) Run(ctx context.Context) error

Run executes the time machine analysis

Jump to

Keyboard shortcuts

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