Documentation ¶
Overview ¶
perfbench is a utility for counting performance events in a Go benchmark.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counters ¶
type Counters struct {
// contains filtered or unexported fields
}
Counters is a set of performance counters that will be reported in benchmark results.
func Open ¶
Open starts a set of performance counters for benchmark b. These counters will be reported as metrics when the benchmark ends. The counters only count performance events on the calling goroutine.
The counters are running on return. In general, any calls to b.StopTimer, b.StartTimer, or b.ResetTimer should be paired with the equivalent calls on Counters.
The final value of the counters is captured in a b.Cleanup function. If the benchmark does substantial other work in cleanup functions, it may want to explicitly call Counters.Stop before returning.