profile

package
v0.0.0-...-ac4698a Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Profile

type Profile struct {
	LoadedPkgNum   int
	LoadPkgTime    time.Duration
	LoadedDefsNum  int
	LoadedUsesNum  int
	SearchedNum    int
	SearchedPkgNum int
	SearchedRefNum int
	SearchedDefNum int
	SearchedTime   time.Duration
	FlushedTime    time.Duration
	ElapsedTime    time.Duration
}

func (*Profile) String

func (s *Profile) String() string

type Profiler

type Profiler interface {
	Init()
	Add(search.Use)
	PkgLoaded([]*packages.Package)
	Searched()
	Flushed()
	Result() *Profile
	Write(io.Writer)
}

func NewNullProfiler

func NewNullProfiler() Profiler

func NewProfiler

func NewProfiler(sw Stopwatch) Profiler

type Stopwatch

type Stopwatch interface {
	// Init starts the stopwatch.
	Init()
	// Memory records the elapsed time.
	Memory(id string)
	Result() map[string]*StopwatchRecord
}

func NewStopwatch

func NewStopwatch() Stopwatch

type StopwatchRecord

type StopwatchRecord struct {
	ID string
	// Elapsed is the elapsed time from Stopwatch.Init().
	Elapsed time.Duration
	// ElapsedSegment is the elapsed time from the previous Stopwatch.Memory()
	// If Stopwatch.Memory() is not called, this is the elapsed time from the Stopwatch.Init().
	ElapsedSegment time.Duration
}

Jump to

Keyboard shortcuts

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