profiler

package
v0.0.0-...-604ee51 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxOverTime_Type = 1
	OverTime_Type    = 2
)

Variables

View Source
var Default_MaxOverTime time.Duration = 5 * time.Second

最大超长时间,一般可以认为是死锁或者死循环,或者极差的性能问题

View Source
var Default_MaxRecordNum int = 100 //最大记录条数
View Source
var Default_OverTime time.Duration = 10 * time.Millisecond

超过该时间将会监控报告

Functions

func DefaultReportFunction

func DefaultReportFunction(name string, callNum int, costTime time.Duration, record *list.List)

func Report

func Report()

func SetReportFunction

func SetReportFunction(reportFun ReportFunType)

Types

type Analyzer

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

func (*Analyzer) Pop

func (slf *Analyzer) Pop()

type Element

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

type Profiler

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

func RegProfiler

func RegProfiler(profilerName string) *Profiler

func (*Profiler) Push

func (slf *Profiler) Push(tag string) *Analyzer

func (*Profiler) SetMaxOverTime

func (slf *Profiler) SetMaxOverTime(tm time.Duration)

func (*Profiler) SetMaxRecordNum

func (slf *Profiler) SetMaxRecordNum(num int)

func (*Profiler) SetOverTime

func (slf *Profiler) SetOverTime(tm time.Duration)

type Record

type Record struct {
	RType      RecordType
	CostTime   time.Duration
	RecordName string
}

type RecordType

type RecordType int

type ReportFunType

type ReportFunType func(name string, callNum int, costTime time.Duration, record *list.List)

Jump to

Keyboard shortcuts

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