analyzer

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package analyzer contains the core TimeMachine logic Full implementation available in the complete source

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"`
}

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"`
	Error         string    `json:"error,omitempty"`
}

type Comparer

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

func NewComparer

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

func (*Comparer) Compare

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

type ComparerConfig

type ComparerConfig struct {
	RepoPath       string
	DockerfilePath string
	Verbose        bool
}

type ComparisonResult

type ComparisonResult 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"`
}

type Config

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

type TimeMachine

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

func NewTimeMachine

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

func (*TimeMachine) AnalyzeCommit

func (tm *TimeMachine) AnalyzeCommit(ctx context.Context, commit interface{}) BuildResult

func (*TimeMachine) GenerateReport

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

func (*TimeMachine) Run

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

Jump to

Keyboard shortcuts

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