Documentation
¶
Index ¶
- func BenchmarkConcurrentScans2(b *testing.B)
- func BenchmarkLargePackage(b *testing.B)
- func BenchmarkMLAnalysis(b *testing.B)
- func BenchmarkMediumPackage(b *testing.B)
- func BenchmarkMemoryUsage2(b *testing.B)
- func BenchmarkSmallPackage(b *testing.B)
- func BenchmarkStressTest(b *testing.B)
- func BenchmarkThroughput(b *testing.B)
- type BenchmarkMetrics
- type BenchmarkResults
- type BenchmarkSuite
- type EnvironmentInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BenchmarkConcurrentScans2 ¶
BenchmarkConcurrentScans2 tests concurrent scanning performance
func BenchmarkLargePackage ¶
BenchmarkLargePackage tests performance with large packages (50+ dependencies)
func BenchmarkMLAnalysis ¶
BenchmarkMLAnalysis tests ML analysis performance
func BenchmarkMediumPackage ¶
BenchmarkMediumPackage tests performance with medium packages (10-50 dependencies)
func BenchmarkMemoryUsage2 ¶
BenchmarkMemoryUsage2 tests memory usage patterns
func BenchmarkSmallPackage ¶
BenchmarkSmallPackage tests performance with small packages (1-10 dependencies)
func BenchmarkStressTest ¶
BenchmarkStressTest performs stress testing with high concurrency
func BenchmarkThroughput ¶
BenchmarkThroughput tests scanning throughput
Types ¶
type BenchmarkMetrics ¶
type BenchmarkMetrics struct {
Duration time.Duration `json:"duration"`
Operations int `json:"operations"`
OpsPerSecond float64 `json:"ops_per_second"`
AvgTimePerOp time.Duration `json:"avg_time_per_op"`
MemoryPerOp uint64 `json:"memory_per_op"`
AllocsPerOp uint64 `json:"allocs_per_op"`
MinTime time.Duration `json:"min_time,omitempty"`
MaxTime time.Duration `json:"max_time,omitempty"`
StdDev time.Duration `json:"std_dev,omitempty"`
ErrorRate float64 `json:"error_rate,omitempty"`
ThroughputMB float64 `json:"throughput_mb,omitempty"`
}
BenchmarkMetrics holds performance metrics for a single benchmark
type BenchmarkResults ¶
type BenchmarkResults struct {
Timestamp time.Time `json:"timestamp"`
Environment EnvironmentInfo `json:"environment"`
Metrics map[string]BenchmarkMetrics `json:"metrics"`
}
BenchmarkResults holds the complete results of a benchmark run
type BenchmarkSuite ¶
type BenchmarkSuite struct {
Duration time.Duration
Parallel int
Iterations int
WarmupDuration time.Duration
Verbose bool
Config *config.Config
Name string `json:"name"`
Description string `json:"description"`
Results map[string]BenchmarkMetrics `json:"results"`
Timestamp time.Time `json:"timestamp"`
Environment EnvironmentInfo `json:"environment"`
// contains filtered or unexported fields
}
BenchmarkSuite manages and executes performance benchmarks
func NewBenchmarkSuite ¶
func NewBenchmarkSuite() *BenchmarkSuite
NewBenchmarkSuite creates a new benchmark suite
func RunBenchmarkSuite ¶
func RunBenchmarkSuite() (*BenchmarkSuite, error)
RunBenchmarkSuite executes a comprehensive benchmark suite
type EnvironmentInfo ¶
type EnvironmentInfo struct {
OS string `json:"os"`
Arch string `json:"arch"`
CPUs int `json:"cpus"`
GoVersion string `json:"go_version"`
MemoryMB int64 `json:"memory_mb"`
Hostname string `json:"hostname"`
}
EnvironmentInfo captures system information
func GetEnvironmentInfo ¶
func GetEnvironmentInfo() EnvironmentInfo
GetEnvironmentInfo collects system information for benchmark context