Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FunctionStat ¶
FunctionStat describes one function's flat contribution to a profile.
type ProfileAnalysis ¶
type ProfileAnalysis struct {
Type ProfileType
Functions []FunctionStat
}
ProfileAnalysis contains the ranked functions for one collected profile.
func AnalyzeProfiles ¶
func AnalyzeProfiles(profiles []*profile.CollectedProfile, limit int) ([]ProfileAnalysis, error)
AnalyzeProfiles returns deterministic, ranked function summaries for the collected profiles. A limit of zero disables analysis.
type ProfileType ¶
type ProfileType string
ProfileType maps to pprof profile types for threshold evaluation.
const ( CPU ProfileType = "cpu" Alloc ProfileType = "alloc" Block ProfileType = "block" Goroutine ProfileType = "goroutine" )
type Threshold ¶
type Threshold struct {
Type ProfileType
Percentage float64
}
Threshold defines a pass/fail gate for a profile type.
func ParseThresholds ¶
ParseThresholds parses a comma-separated threshold string like "cpu:30,alloc:50".
type Violation ¶
Violation records a function that exceeded its threshold.
func CheckThresholds ¶
func CheckThresholds(profiles []*profile.CollectedProfile, thresholds []Threshold) ([]Violation, error)
CheckThresholds evaluates collected profiles against thresholds. Returns violations for functions exceeding their threshold.