Documentation
¶
Index ¶
- Constants
- func FindStackSubmatchIndex(stk []*trace.Frame, specs ...string) []int
- func HasStackRe(stk []*trace.Frame, specs ...string) bool
- func TrimVendor(fn string) string
- func Uncovered(parent TimeSpan, children ...TimeSpan) time.Duration
- type Data
- type EventList
- type GeneralTracker
- type ProcessRegionConnectionsInput
- type ProcessRegionConnectionsResult
- type Region
- type RegionConnector
- func (rc *RegionConnector) DoApplyOnWake(ev *trace.Event, existing, inbound *RegionStack) *RegionStack
- func (rc *RegionConnector) DoStartRegion(ev *trace.Event, existing, starting *RegionStack) *RegionStack
- func (rc *RegionConnector) Process(in *ProcessRegionConnectionsInput) *ProcessRegionConnectionsResult
- type RegionStack
- type StackFlag
- type Task
- type TimeSpan
- type TrackerState
Constants ¶
const (
)
Variables ¶
This section is empty.
Functions ¶
func FindStackSubmatchIndex ¶
FindStackSubmatchIndex searches stk for subexpressions described in specs. It returns a slice of offsets in groups of three. The first element in each group is number of leaf frames skipped before finding the subexpression. The next two elements are the start and end byte offsets within that frame's function name.
func TrimVendor ¶
Types ¶
type Data ¶
type Data struct {
// Result holds the event list from a basic execution trace parse result.
// The events are chronological order.
Events []*trace.Event
// GoroutineEvents maps each observed goroutine to that goroutine's events.
GoroutineEvents map[uint64][]*trace.Event
// GoroutineList lists all known goroutines by ID
GoroutineList []uint64
// Backlinks holds events that are the targets of other events' Link field.
Backlinks map[*trace.Event]*trace.Event
// GoroutineRuns maps GoStart events to the sequence of events on that
// goroutine that followed, until the goroutine stopped running.
GoroutineRuns map[*trace.Event][]*trace.Event
// Prev maps an event to the preceding event on the same goroutine.
Prev map[*trace.Event]*trace.Event
// Next maps an event to the subsequent event on the same goroutine.
Next map[*trace.Event]*trace.Event
}
func PrepareData ¶
type GeneralTracker ¶
type GeneralTracker struct {
// Activate returns whether the event marks the start of a new Region.
Activate func(ev *trace.Event) bool
// Keepalive returns whether the event indicates the Region is still active.
Keepalive func(ev *trace.Event) bool
// Critical returns whether the event is a critical part of the Region
// lifecycle. Events that are not critical to a Region's lifecycle are
// trimmed from the end.
Critical func(ev *trace.Event) bool
// Reactivate controls whether the GeneralTracker finds the largest or
// smallest possible Regions. When true, the GeneralTracker will try to
// start a new Region for any Event that matches the Activate function. When
// false, it tries to add Events to an existing Region.
Reactivate bool
// AllowSingle enables single-event Regions. Otherwise, the smallest
// possible Region is 2 events.
AllowSingle bool
// FlushAtEnd attempts to write out any partial Region at the goroutine's
// final Event.
FlushAtEnd bool
Verbose bool
// Flush is called with the Events that make up a single Region.
Flush func([]*trace.Event)
// contains filtered or unexported fields
}
func (*GeneralTracker) Process ¶
func (t *GeneralTracker) Process(evs []*trace.Event)
type ProcessRegionConnectionsResult ¶
type ProcessRegionConnectionsResult struct {
EventRegionStacks map[*trace.Event]*RegionStack
}
type Region ¶
A Region is a contiguous series of Events on a single goroutine to accomplish a particular goal.
type RegionConnector ¶
type RegionConnector struct {
// StartRegion sets the new RegionStack of a goroutine when it starts a new
// local Region. If left unset, the RegionConnector uses a default behavior
// of adding the starting RegionStack on top of the existing RegionStack.
StartRegion func(ev *trace.Event, existing, starting *RegionStack) *RegionStack
// ApplyOnWake sets the new RegionStack for a goroutine when it is made
// runnable by another goroutine's event ev. The GoStart event for the
// now-runnable goroutine is ev.Link. If left unset, the RegionConnector
// uses a default behavior of trimming the inbound RegionStack back to
ApplyOnWake func(ev *trace.Event, existing, inbound *RegionStack) *RegionStack
}
func (*RegionConnector) DoApplyOnWake ¶
func (rc *RegionConnector) DoApplyOnWake(ev *trace.Event, existing, inbound *RegionStack) *RegionStack
func (*RegionConnector) DoStartRegion ¶
func (rc *RegionConnector) DoStartRegion(ev *trace.Event, existing, starting *RegionStack) *RegionStack
func (*RegionConnector) Process ¶
func (rc *RegionConnector) Process(in *ProcessRegionConnectionsInput) *ProcessRegionConnectionsResult
type RegionStack ¶
type RegionStack struct {
// Start marks when this goroutine began the current explanation for its
// work.
Start *trace.Event
// Local is a Region on this goroutine that explains its current work. If
// this goroutine is working on behalf of another and does not have an
// annotation for its own work, this field will be nil.
Local *Region
// Parent links to the higher-level reason for the current work.
Parent *RegionStack
}
A RegionStack is an immutable linked list of Regions and inbound communication events that explain why the program is currently doing a unit of work.
func (*RegionStack) DebugString ¶
func (rs *RegionStack) DebugString() string
type StackFlag ¶
func (*StackFlag) EventMatches ¶
type Task ¶
A Task is a set of Regions (across any number of goroutines) that work together to accomplish a particular goal.
type TrackerState ¶
type TrackerState func(*trace.Event) TrackerState