profiling

package
v0.0.0-...-039008f Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultProfiling

type DefaultProfiling struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*DefaultProfiling) AddCheckpoint

func (prof *DefaultProfiling) AddCheckpoint(name string) error

func (*DefaultProfiling) AddCheckpointWithTime

func (prof *DefaultProfiling) AddCheckpointWithTime(name string, time time.Time) error

func (*DefaultProfiling) Clear

func (prof *DefaultProfiling) Clear()

func (*DefaultProfiling) FinishExecution

func (prof *DefaultProfiling) FinishExecution(save bool) error

func (*DefaultProfiling) FinishExecutionWithTime

func (prof *DefaultProfiling) FinishExecutionWithTime(save bool, finishTime time.Time) error

func (*DefaultProfiling) GetCount

func (prof *DefaultProfiling) GetCount() int

func (*DefaultProfiling) GetQPSStatistics

func (prof *DefaultProfiling) GetQPSStatistics() (*QPSStatistics, error)

func (*DefaultProfiling) GetTimeStatistics

func (prof *DefaultProfiling) GetTimeStatistics() *TimeStatistics

func (*DefaultProfiling) StartExecution

func (prof *DefaultProfiling) StartExecution()

func (*DefaultProfiling) StartExecutionWithTime

func (prof *DefaultProfiling) StartExecutionWithTime(time time.Time)

type EmptyProfiling

type EmptyProfiling struct {
	Profiling
}

func (*EmptyProfiling) AddCheckpoint

func (ep *EmptyProfiling) AddCheckpoint(name string) error

func (*EmptyProfiling) AddCheckpointWithTime

func (ep *EmptyProfiling) AddCheckpointWithTime(name string, time time.Time) error

func (*EmptyProfiling) FinishExecution

func (ep *EmptyProfiling) FinishExecution(save bool) error

func (*EmptyProfiling) FinishExecutionWithTime

func (ep *EmptyProfiling) FinishExecutionWithTime(save bool, finishTime time.Time) error

func (*EmptyProfiling) GetCount

func (ep *EmptyProfiling) GetCount() int

func (*EmptyProfiling) GetQPSStatistics

func (ep *EmptyProfiling) GetQPSStatistics() (*QPSStatistics, error)

func (*EmptyProfiling) GetTimeStatistics

func (ep *EmptyProfiling) GetTimeStatistics() *TimeStatistics

func (*EmptyProfiling) StartExecution

func (ep *EmptyProfiling) StartExecution()

func (*EmptyProfiling) StartExecutionWithTime

func (ep *EmptyProfiling) StartExecutionWithTime(time time.Time)

type Profiling

type Profiling interface {
	StartExecution()
	StartExecutionWithTime(time time.Time)
	FinishExecution(save bool) error
	FinishExecutionWithTime(save bool, finishTime time.Time) error
	AddCheckpoint(name string) error
	AddCheckpointWithTime(name string, time time.Time) error
	GetCount() int
	Clear()
	GetTimeStatistics() *TimeStatistics
	GetQPSStatistics() (*QPSStatistics, error)
}

func GetProfilingFromCache

func GetProfilingFromCache(name string) Profiling

func GetProfilingFromCacheOrEmpty

func GetProfilingFromCacheOrEmpty(name string) Profiling

func InitProfilingInCache

func InitProfilingInCache(name string) Profiling

func NewEmptyProfiling

func NewEmptyProfiling() Profiling

func NewProfiling

func NewProfiling() Profiling

func NewProfilingWithTime

func NewProfilingWithTime(startTime time.Time) Profiling

type ProfilingCache

type ProfilingCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type QPSStatistics

type QPSStatistics struct {
	FromTime  time.Time
	ToTime    time.Time
	Count     int
	StagesQPS map[string]*StageQPS
}

type StageQPS

type StageQPS struct {
	From string
	To   string
	// qps per second between from-time and to-time
	Samples []int
	AvgQPS  float64
	MaxQPS  int
}

type StageTime

type StageTime struct {
	From       string
	To         string
	Count      int
	TotalTime  time.Duration
	AvgTime    time.Duration
	Percentage float64
}

type TimeStatistics

type TimeStatistics struct {
	StartTime  time.Time
	FinishTime time.Time
	Count      int
	TotalTime  time.Duration
	AvgTime    time.Duration
	StagesTime []*StageTime
}

* statistics

Jump to

Keyboard shortcuts

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