goroutine

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAnalyzer

func GetAnalyzer() *analyzer

func StartLeakCheck

func StartLeakCheck(
	stopper *stopper.Stopper,
	cfg Config)

Types

type AnalyzeResult

type AnalyzeResult struct {
	Goroutines []Goroutine
	// contains filtered or unexported fields
}

AnalyzeResult analyze result

func (AnalyzeResult) Display

func (res AnalyzeResult) Display(
	top int,
	filter func(i, j int) (bool, bool)) string

func (AnalyzeResult) GroupCount

func (res AnalyzeResult) GroupCount() int

func (AnalyzeResult) String

func (res AnalyzeResult) String() string

type Analyzer

type Analyzer interface {
	ParseSystem() ([]Goroutine, error)
	Parse(stack []byte) []Goroutine
	GroupAnalyze([]Goroutine) AnalyzeResult
}

type Config

type Config struct {
	// EnableLeakCheck enable goroutine leak check
	EnableLeakCheck bool `toml:"enable-leak-check"`
	// SuspectLeakCount if goroutine count > suspect-leak-count, maybe leak. Default is 10000.
	SuspectLeakCount int `toml:"suspect-leak-count"`
	// CheckDuration check goroutine duration. Default is 1 hour.
	CheckDuration toml.Duration `toml:"check-duration"`
}

Config leak check config

type Goroutine

type Goroutine struct {
	ID             int
	State          string
	BlockedMinutes int
	// contains filtered or unexported fields
}

Goroutine goroutine

func (Goroutine) CreateBy

func (g Goroutine) CreateBy() (string, string)

func (Goroutine) Has

func (g Goroutine) Has(value string) bool

func (Goroutine) IsEmpty

func (g Goroutine) IsEmpty() bool

func (Goroutine) Last

func (g Goroutine) Last() string

func (Goroutine) String

func (g Goroutine) String() string

Jump to

Keyboard shortcuts

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