Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllRunning ¶
AllRunning returns time ranges relative to the Span's start when any children of the span were running and when any children of the span were blocked on the network.
Types ¶
type Ranges ¶
type Span ¶
type Span struct {
// G is the id of the goroutine that executed this Span
G uint64
// Kind names this type of Span
Kind string
// StartNs is the start time of this Span measured in nanoseconds.
StartNs int64
// LengthNs is the duration of this Span measured in nanoseconds.
LengthNs int64
// StartRun is a list of times when the goroutine started running. It is
// measured in nanoseconds relative to StartNs.
StartRun []int64
// StartAssist describes the starts of stretches of time when the goroutine
// was running, but was not running its own code. An entry in the "gc" list
// here describes when the goroutine started doing GC Assist work.
StartAssist map[string][]int64
// StartWait describes the starts of stretches of time when the goroutine
// was not running because it was waiting for some kind of event. An entry
// in the "net" list here describes when the goroutine started blocking
// because it needed to read data from the network. An entry in the "cpu"
// list here describes when the goroutine becomes runnable.
StartWait map[string][]int64
// Caused lists Spans that this Span caused to exist.
Caused []*Span
}
A Span describes a single goroutine's contribution of a unit of useful work.
type TreeSummary ¶
type TreeSummary struct {
// LengthNs is the duration of this tree of Spans measured in nanoseconds.
LengthNs int64
// TotalRunNs is the total amount of CPU time these Spans consumed.
TotalRunNs int64
// TotalAssistNs is the total amount of CPU time these Spans spent doing
// non-application work.
TotalAssistNs map[string]int64
// FlatRunNs is the amount of wall-clock time attributable to on-CPU time.
//
// When collapsing a set of timelines (one for each Span) into a single
// timeline, time ranges where any Span was on-CPU counts as on-CPU time in
// the single flattened timeline.
//
// Similarly, time ranges there at least one Span was doing assist work
// counts as time doing assist work in the flattened view, in addition to
// being on-CPU time. Priority for attributing assist work starts with "gc"
// assist.
//
// Time ranges where every Span is waiting are counted as waiting in the
// flat view. Priority is as follows:
// - "cpu" is first, to follow the high preference given to on-CPU time.
// - "gc" is second, again because it's getting in the way of what would be on-CPU time.
// - "net", as it's likely to represent forces outside of the process.
// - "syscall", again because it's likely to show us interesting cross-process waiting.
// - Finally, process-internal synchronization: "select", "recv", "send", "cond", "sync", "block".
FlatRunNs int64
FlatAssistNs map[string]int64
FlatWaitNs map[string]int64
Flat *Span
Root *Span
}
A TreeSummary describes the overall behavior of a tree of Spans.
func Summarize ¶
func Summarize(root *Span) *TreeSummary
Click to show internal directories.
Click to hide internal directories.