frame

package
v0.0.0-...-7b4f1aa Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasDeadLock

func HasDeadLock(f1, f2 *Goroutine) bool

Types

type Goroutine

type Goroutine struct {
	Id       int
	Header   string
	Trace    string
	Lines    int
	Duration int // In minutes.
	Metas    map[MetaType]string

	LineMd5      []string
	FullMd5      string
	FullHasher   hash.Hash
	Duplicates   []ShortSlim
	IsLockHolder bool
	LockHolders  []string

	Frozen bool
	Buf    *bytes.Buffer
}

Goroutine contains a goroutine info.

func NewGoroutine

func NewGoroutine(metaline string) (*Goroutine, error)

NewGoroutine creates and returns a new Goroutine.

func (*Goroutine) AddLine

func (g *Goroutine) AddLine(l string)

AddLine appends a line to the goroutine info.

func (*Goroutine) Freeze

func (g *Goroutine) Freeze()

Freeze freezes the goroutine info.

func (Goroutine) Print

func (g Goroutine) Print(w io.Writer) error

Print outputs the goroutine details to w.

func (Goroutine) PrintWithColor

func (g Goroutine) PrintWithColor()

PrintWithColor outputs the goroutine details to stdout with color.

type GoroutineDump

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

GoroutineDump defines a goroutine dump.

func NewGoroutineDump

func NewGoroutineDump() *GoroutineDump

NewGoroutineDump creates and returns a new GoroutineDump.

func NewGoroutineDumpFromMap

func NewGoroutineDumpFromMap(gs map[int]*Goroutine) *GoroutineDump

NewGoroutineDumpFromMap creates and returns a new GoroutineDump from a map.

func (*GoroutineDump) Add

func (gd *GoroutineDump) Add(g *Goroutine)

Add appends a goroutine info to the list.

func (GoroutineDump) Copy

func (gd GoroutineDump) Copy(cond string) *GoroutineDump

Copy duplicates and returns the GoroutineDump.

func (*GoroutineDump) Dedup

func (gd *GoroutineDump) Dedup() []*Goroutine

func (*GoroutineDump) Delete

func (gd *GoroutineDump) Delete(cond string) error

Delete deletes by the condition.

func (*GoroutineDump) Diff

Diff shows the difference between two dumps.

func (*GoroutineDump) Keep

func (gd *GoroutineDump) Keep(cond string) error

Keep keeps by the condition.

func (GoroutineDump) Save

func (gd GoroutineDump) Save(fn string) error

Save saves the goroutine dump to the given file.

func (GoroutineDump) Search

func (gd GoroutineDump) Search(cond string, offset, limit int)

Search displays the goroutines with the offset and limit.

func (GoroutineDump) Show

func (gd GoroutineDump) Show(offset, limit int)

Show displays the goroutines with the offset and limit.

func (*GoroutineDump) Sort

func (gd *GoroutineDump) Sort()

Sort sorts the goroutine entries.

func (GoroutineDump) Summary

func (gd GoroutineDump) Summary()

Summary prints the summary of the goroutine dump.

type MetaType

type MetaType int
var (
	MetaState    MetaType = 0
	MetaDuration MetaType = 1
)

type ShortSlim

type ShortSlim struct {
	Gid      int
	Duration int
}

Jump to

Keyboard shortcuts

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