Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶ added in v0.7.0
FormatDuration formats a duration into a human-readable string showing days, hours, minutes and seconds as appropriate
Types ¶
type G ¶
type G struct {
Address uint64 `json:"address"` // goroutine structure address
Goid int64 `json:"go_id"` // goroutine ID
Status string `json:"status"` // goroutine status
WaitReason string `json:"wait_reason"` // wait reason
Stack Stack `json:"stack"` // Stack info
M uint64 `json:"-"` // associated M structure address
Sched Sched `json:"sched"` // scheduling info
AtomicStatus uint32 `json:"-"` // raw status value
FuncName string `json:"func_name"` // currently running function name
StartPC uint64 `json:"start_pc"` // starting function address
StartFuncName string `json:"start_func_name"` // starting function name
}
type MemStat ¶
type MemStat struct {
// Garbage collector statistics
// NextGC uint64 // next collection will happen when HeapAlloc ≥ this amount
LastGC uint64 `json:"last_gc"` // end time of last collection (unixtimestamp in seconds)
PauseTotalNs uint64 `json:"pause_total_ns"`
PauseNs [256]uint64 `json:"-"` // circular buffer of recent GC pause durations
PauseEnd [256]uint64 `json:"-"` // circular buffer of recent GC pause end times
NumGC uint32 `json:"num_gc"`
}
type ProcessMemReader ¶ added in v0.7.0
type ProcessMemReader interface {
io.ReaderAt
Close() error
RuntimeInfo() (*Runtime, error)
Goroutines(showDead bool) ([]G, error)
GetGoroutineStackTraceByGoID(goid int64) ([]StackFrame, error)
Ps() ([]P, error)
MemStat() (*MemStat, error)
}
func NewProcessMemReader ¶ added in v0.7.0
func NewProcessMemReader(pid int, binPath string) (ProcessMemReader, error)
NewProcessMemReader creates a new memory reader for the specified process. On Linux it uses /proc/<pid>/mem, on Darwin it uses mach_vm_read.
type Runtime ¶ added in v0.7.0
type Runtime struct {
InitTime int64 `json:"-"` // when runtime was initialized(monotime)
GoVersion string `json:"go_version"` // Go runtime version
}
G represents a goroutine with detailed information
Click to show internal directories.
Click to hide internal directories.