Documentation
¶
Overview ¶
Package benchmark runs `go test` benchmarks with profiling flags, materializes outputs under bench/<tag>/, drives pprof text/PNG and per-function extraction via collector, and discovers Benchmark* functions in the module.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ExpectedFiles = map[string]string{
"cpu": "cpu.out",
"memory": "memory.out",
"mutex": "mutex.out",
"block": "block.out",
}
ExpectedFiles maps profile names to expected pprof output filenames.
View Source
var ProfileFlags = map[string]string{
"cpu": "-cpuprofile=cpu.out",
"memory": "-memprofile=memory.out",
"mutex": "-mutexprofile=mutex.out",
"block": "-blockprofile=block.out",
}
ProfileFlags maps profile names to go test profiling flags.
View Source
var SupportedProfiles = []string{"cpu", "memory", "mutex", "block"}
SupportedProfiles lists profile kinds supported by the benchmark pipeline.
Functions ¶
func DiscoverBenchmarks ¶ added in v1.7.0
DiscoverBenchmarks scans for functions matching:
func BenchmarkXxx(b *testing.B) { ... }
If scope is non-empty, search starts there; otherwise the module root is used.
Types ¶
type ProfilePaths ¶
type ProfilePaths struct {
// Desired file path for specified profile
ProfileTextFile string
// Desired bin path for specified profile
ProfileBinaryFile string
// Desired benchmark directory for function data collection
FunctionDirectory string
}
ProfilePaths holds paths for profile text, binary, and output directories.
Click to show internal directories.
Click to hide internal directories.