Documentation
¶
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",
}
View Source
var ProfileFlags = map[string]string{
"cpu": "-cpuprofile=cpu.out",
"memory": "-memprofile=memory.out",
"mutex": "-mutexprofile=mutex.out",
"block": "-blockprofile=block.out",
}
View Source
var SupportedProfiles = []string{"cpu", "memory", "mutex", "block"}
Functions ¶
func DiscoverBenchmarks ¶ added in v1.7.0
DiscoverBenchmarks scans the Go module for benchmark functions and returns their names. A benchmark is identified by functions matching:
func BenchmarkXxx(b *testing.B) { ... }
If scope is provided, only searches within that directory and its subdirectories. If scope is empty, searches the entire module from the root.
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.