perfutils

package
v2.1.46+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplyMessage = iota
	ApplyTransaction
	CliqueSeal
	CliqueSnapshot
	CliqueVerifySeal
	CreateBloom
	Finalize
	GetLogs
	IntermediateRoot
	NewEVMContext
	NewEVMPool
	NewReceipt
	Process
	SignerSender
	StatedbFinalize
	StatedbPrepare
	TxAsMessage
)

Variables

This section is empty.

Functions

func WithTimer

func WithTimer(ctx context.Context) context.Context

Types

type NoopSection

type NoopSection struct {
}

func (*NoopSection) Count

func (ps *NoopSection) Count() int64

func (*NoopSection) Name

func (ps *NoopSection) Name() string

func (*NoopSection) Stop

func (ps *NoopSection) Stop()

func (*NoopSection) TotalDuration

func (ps *NoopSection) TotalDuration() time.Duration

type NoopTimer

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

func (*NoopTimer) Fprint

func (t *NoopTimer) Fprint(w io.Writer)

func (*NoopTimer) Print

func (t *NoopTimer) Print() string

func (*NoopTimer) Start

func (t *NoopTimer) Start(s section) PerfRun

type PerfRun

type PerfRun interface {
	Stop()
}

PerfRun keep time for each particular run

type PerfRunNormal

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

func (*PerfRunNormal) Stop

func (pr *PerfRunNormal) Stop()

type PerfSection

type PerfSection interface {
	Name() string
	TotalDuration() time.Duration
	Count() int64
}

type PerfSectionNormal

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

func (*PerfSectionNormal) Count

func (ps *PerfSectionNormal) Count() int64

func (*PerfSectionNormal) Name

func (ps *PerfSectionNormal) Name() string

func (*PerfSectionNormal) TotalDuration

func (ps *PerfSectionNormal) TotalDuration() time.Duration

type PerfTimer

type PerfTimer interface {
	Start(section) PerfRun
	Print() string
	Fprint(w io.Writer)
}

PerfTimer is a way to time pieces of code, in particular ones that happen many times, then get the metrics for it.

func GetTimer

func GetTimer(ctx context.Context) PerfTimer

func NewPerfTimer

func NewPerfTimer() PerfTimer

type PerfTimerNormal

type PerfTimerNormal struct {
	// Sections map[string]*PerfSectionNormal
	Sections sync.Map
}

PerfTimerNormal great name huh?

func (*PerfTimerNormal) Fprint

func (pt *PerfTimerNormal) Fprint(w io.Writer)

func (*PerfTimerNormal) Print

func (pt *PerfTimerNormal) Print() string

func (*PerfTimerNormal) Start

func (pt *PerfTimerNormal) Start(s section) PerfRun

Jump to

Keyboard shortcuts

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