model

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseStackPos added in v1.0.2

func ParseStackPos(text string) (fileName string, line int32, pos *int, err error)

For example /usr/local/go/src/net/http/server.go:2969 +0x970

func StackContains

func StackContains(sf []StackFrame, subString string) bool

StackContains returns true if string is included on one of the elements of the stack slice

Types

type Goroutine

type Goroutine struct {
	ID             int64
	Status         string // TODO: move known states to array and use slice for unknown
	WaitSinceMin   int64
	StackTrace     []StackFrame
	CratedBy       *StackFrame // Only one frame long. Nill if not set
	LockedToThread bool
}

Goroutine info from pprof API. See: https://github.com/DataDog/go-profiler-notes/blob/main/goroutine.md Status Details: See: https://github.com/golang/go/blob/go1.15.6/src/runtime/runtime2.go#L14-L105 and https://github.com/golang/go/blob/go1.15.6/src/runtime/runtime2.go#L996-L1024

func ParseHeader added in v1.0.2

func ParseHeader(header string) (routine Goroutine, err error)

ParseHeader of stack trace. See: https://golang.org/src/runtime/traceback.go?s=30186:30213#L869

func ParseStackFrame

func ParseStackFrame(reader io.Reader) (routines []Goroutine, err error)

ParseStackFrame reads full file and return all goroutines as slice

type StackFrame

type StackFrame struct {
	FuncName string
	File     string
	Line     int32
	Position *int // Relative stack position. Not mandatory
}

StackFrame contains the info for one stack frame See: https://dev.to/mcaci/reading-stack-traces-in-go-3ah5

func (StackFrame) String

func (s StackFrame) String() string

Jump to

Keyboard shortcuts

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