metrics

package
v0.0.0-...-a9a38bb Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyzePrs

func AnalyzePrs(prs []*github.PrData)

AnalyzePrs iterates through a slice of PrData, calculates metrics, and prints them.

Types

type NormalDistributionEstimates

type NormalDistributionEstimates struct {
	Mean        time.Duration
	StdDev      time.Duration
	P50         time.Duration // 50th percentile (median)
	P80         time.Duration // 80th percentile
	P90         time.Duration // 90th percentile
	P95         time.Duration // 95th percentile
	SampleCount int
}

NormalDistributionEstimates holds percentile estimates for a given metric.

func EstimateTimesUsingNormalDistribution

func EstimateTimesUsingNormalDistribution(metrics []*PrMetrics, selector func(*PrMetrics) time.Duration, metricName string) NormalDistributionEstimates

EstimateTimesUsingNormalDistribution calculates normal distribution-based estimates for a given time metric from a slice of PrMetrics. It takes a selector function to pick the duration from each PrMetrics object.

type PrMetrics

type PrMetrics struct {
	Number            int
	Title             string
	TimeToFirstReview time.Duration
	TimeToMerge       time.Duration
	ReviewToMerge     time.Duration
	Additions         int
	Deletions         int
	ChangedFiles      int
	State             string
}

PrMetrics holds calculated metrics for a single Pull Request.

func CalculateMetrics

func CalculateMetrics(pr *github.PrData) *PrMetrics

CalculateMetrics computes various time-based metrics for a single PR.

Jump to

Keyboard shortcuts

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