perfbench

package
v0.0.0-...-b6c5e5e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

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

func Open(b *testing.B) *Counters

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.

func (*Counters) Reset

func (cs *Counters) Reset()

func (*Counters) Start

func (cs *Counters) Start()

func (*Counters) Stop

func (cs *Counters) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL