perf

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2019 License: MIT Imports: 11 Imported by: 265

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallerName

func CallerName(skip int) timerOpt

func Log

func Log(t *Timer)

func Name

func Name(name string) func(*Timer)

func ScopeTimer

func ScopeTimer(opts ...timerOpt) func()

func ScopeTimerErr

func ScopeTimerErr(err *error) func()

func ScopeTimerOk

func ScopeTimerOk(ok *bool) func()

func WriteEventsTable

func WriteEventsTable(w io.Writer)

Types

type Event

type Event struct {
	Mu    sync.RWMutex
	Count int64
	Total time.Duration
	Min   time.Duration
	Max   time.Duration
}

func (*Event) Add

func (e *Event) Add(t time.Duration)

func (*Event) Init

func (e *Event) Init()

func (*Event) MeanTime

func (e *Event) MeanTime() time.Duration

type NamedEvent

type NamedEvent struct {
	Name string
	Event
}

type TimedLocker

type TimedLocker struct {
	L    sync.Locker
	Desc string
}

func (*TimedLocker) Lock

func (me *TimedLocker) Lock()

func (*TimedLocker) Unlock

func (me *TimedLocker) Unlock()

type TimedRWLocker

type TimedRWLocker struct {
	RWL       missinggo.RWLocker
	WriteDesc string
	ReadDesc  string
}

func (*TimedRWLocker) Lock

func (me *TimedRWLocker) Lock()

func (*TimedRWLocker) RLock

func (me *TimedRWLocker) RLock()

func (*TimedRWLocker) RUnlock

func (me *TimedRWLocker) RUnlock()

func (*TimedRWLocker) Unlock

func (me *TimedRWLocker) Unlock()

type Timer

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

func NewTimer

func NewTimer(opts ...timerOpt) (t *Timer)

func (*Timer) Mark

func (t *Timer) Mark(events ...string) time.Duration

func (*Timer) MarkErr

func (t *Timer) MarkErr(err error)

func (*Timer) MarkOk

func (t *Timer) MarkOk(ok bool)

Jump to

Keyboard shortcuts

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