monitor

package
v0.0.0-...-232b4bc Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Close    monitorFlag       = 1 << iota //	关闭监控,不采集任何信息。
	Func                                   //	开启监控,输出主要信息(调用时间,和调用方信息)
	Periodic                               //	开启监控,每分钟输出平均调用时间,以及调用次数
	All      = Func | Periodic             //	全部信息,打印所有信息
)

Variables

View Source
var M iMonitor

Functions

func Init

func Init(l monitorFlag, tcb tcCollBack, t time.Duration)

func Run

func Run()

Types

type Monitor

type Monitor struct {
}

func (*Monitor) TimeCost

func (this *Monitor) TimeCost(ctx context.Context, skip int) func()

TimeCost ,The argument skip is the number of stack frames to ascend, with 0 identifying the caller of Caller.

type SyncSlice

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

func (*SyncSlice) Add

func (s *SyncSlice) Add(i interface{})

func (*SyncSlice) Clear

func (s *SyncSlice) Clear() []interface{}

func (*SyncSlice) Count

func (s *SyncSlice) Count() int

Jump to

Keyboard shortcuts

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