driver

package
v0.0.0-...-f862e5e Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatPeakRSS = "peak-RSS-bytes"
	StatPeakVM  = "peak-VM-bytes"
	StatAvgRSS  = "average-RSS-bytes"
	StatTime    = "ns/op"
)

Variables

Functions

func CopyDiagnosticData

func CopyDiagnosticData(diagPath string, typ diagnostics.Type, pattern string) error

func DiagnosticEnabled

func DiagnosticEnabled(typ diagnostics.Type) bool

func PerfFlags

func PerfFlags() []string

func ProcessPeakRSS

func ProcessPeakRSS(s *os.ProcessState) uint64

func ReadPeakRSS

func ReadPeakRSS(pid int) (uint64, error)

func ReadPeakVM

func ReadPeakVM(pid int) (uint64, error)

func ReadRSS

func ReadRSS(pid int) (uint64, error)

func RunBenchmark

func RunBenchmark(name string, f func(*B) error, opts ...RunOption) error

func SetFlags

func SetFlags(f *flag.FlagSet)

func WritePprofProfile

func WritePprofProfile(prof *profile.Profile, typ diagnostics.Type, pattern string) error

Types

type B

type B struct {
	// contains filtered or unexported fields
}

func (*B) Context

func (b *B) Context() context.Context

func (*B) Elapsed

func (b *B) Elapsed() time.Duration

func (*B) Name

func (b *B) Name() string

func (*B) Ops

func (b *B) Ops(ops int)

func (*B) Report

func (b *B) Report(name string, value uint64)

func (*B) ResetTimer

func (b *B) ResetTimer()

func (*B) StartTimer

func (b *B) StartTimer()

func (*B) StopTimer

func (b *B) StopTimer()

func (*B) TimerRunning

func (b *B) TimerRunning() bool

type RunOption

type RunOption func(*B)

func BenchmarkPID

func BenchmarkPID(pid int) RunOption

func DoAvgRSS

func DoAvgRSS(f func() (uint64, error)) RunOption

func DoCPUProfile

func DoCPUProfile(v bool) RunOption

func DoCoreDump

func DoCoreDump(v bool) RunOption

func DoDefaultAvgRSS

func DoDefaultAvgRSS() RunOption

func DoMemProfile

func DoMemProfile(v bool) RunOption

func DoPeakRSS

func DoPeakRSS(v bool) RunOption

func DoPeakVM

func DoPeakVM(v bool) RunOption

func DoPerf

func DoPerf(v bool) RunOption

func DoTime

func DoTime(v bool) RunOption

func DoTrace

func DoTrace(v bool) RunOption

func WithContext

func WithContext(ctx context.Context) RunOption

func WithGOMAXPROCS

func WithGOMAXPROCS(procs int) RunOption

func WriteResultsTo

func WriteResultsTo(wr io.Writer) RunOption

Jump to

Keyboard shortcuts

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