go/src/internal/trace/traceviewer/emitter.go

type TraceConsumer

// ViewerDataTraceConsumer returns a TraceConsumer that writes to w. The
// startIdx and endIdx are used for splitting large traces. They refer to
// indexes in the traceEvents output array, not the events in the trace input.
func ViewerDataTraceConsumer(w io.Writer, startIdx, endIdx int64) TraceConsumer {}

func SplittingTraceConsumer(max int) (*splitter, TraceConsumer) {}

type splitter

type countingWriter

func (cw *countingWriter) Write(data []byte) (int, error) {}

func stackFrameEncodedSize(id uint, f format.Frame) int {}

// WalkStackFrames calls fn for id and all of its parent frames from allFrames.
func WalkStackFrames(allFrames map[string]format.Frame, id int, fn func(id int)) {}

type Mode

const ModeGoroutineOriented

const ModeTaskOriented

const ModeThreadOriented

// NewEmitter returns a new Emitter that writes to c. The rangeStart and
// rangeEnd args are used for splitting large traces.
func NewEmitter(c TraceConsumer, rangeStart, rangeEnd time.Duration) *Emitter {}

type Emitter

type task

func (e *Emitter) Gomaxprocs(v uint64) {}

func (e *Emitter) Resource(id uint64, name string) {}

func (e *Emitter) SetResourceType(name string) {}

func (e *Emitter) SetResourceFilter(filter func(uint64) bool) {}

func (e *Emitter) Task(id uint64, name string, sortIndex int) {}

func (e *Emitter) Slice(s SliceEvent) {}

func (e *Emitter) TaskSlice(s SliceEvent) {}

func (e *Emitter) slice(s SliceEvent, sectionID uint64, cname string) {}

type SliceEvent

func (e *Emitter) AsyncSlice(s AsyncSliceEvent) {}

type AsyncSliceEvent

func (e *Emitter) Instant(i InstantEvent) {}

type InstantEvent

func (e *Emitter) Arrow(a ArrowEvent) {}

func (e *Emitter) TaskArrow(a ArrowEvent) {}

func (e *Emitter) arrow(a ArrowEvent, sectionID uint64) {}

type ArrowEvent

func (e *Emitter) Event(ev *format.Event) {}

func (e *Emitter) HeapAlloc(ts time.Duration, v uint64) {}

func (e *Emitter) Focus(id uint64) {}

func (e *Emitter) GoroutineTransition(ts time.Duration, from, to GState) {}

func (e *Emitter) IncThreadStateCount(ts time.Duration, state ThreadState, delta int64) {}

func (e *Emitter) HeapGoal(ts time.Duration, v uint64) {}

func (e *Emitter) emitHeapCounters(ts time.Duration) {}

// Err returns an error if the emitter is in an invalid state.
func (e *Emitter) Err() error {}

func (e *Emitter) tsWithinRange(ts time.Duration) bool {}

// OptionalEvent emits ev if it's within the time range of the consumer, i.e.
// the selected trace split range.
func (e *Emitter) OptionalEvent(ev *format.Event) {}

func (e *Emitter) Flush() {}

func (e *Emitter) threadMeta(sectionID, tid uint64, name string, priority int) {}

func (e *Emitter) processMeta(sectionID uint64, name string, priority int) {}

// Stack emits the given frames and returns a unique id for the stack. No
// pointers to the given data are being retained beyond the call to Stack.
func (e *Emitter) Stack(stk []*trace.Frame) int {}

// buildBranch builds one branch in the prefix tree rooted at ctx.frameTree.
func (e *Emitter) buildBranch(parent frameNode, stk []*trace.Frame) int {}

type heapStats

func viewerTime(t time.Duration) float64 {}

type GState

const GDead

const GRunnable

const GRunning

const GWaiting

const GWaitingGC

const gStateCount

type ThreadState

const ThreadStateInSyscall

const ThreadStateInSyscallRuntime

const ThreadStateRunning

const threadStateCount

type frameNode

const colorLightMauve

const colorOrange

const colorSeafoamGreen

const colorVistaBlue

const colorTan

const colorIrisBlue

const colorMidnightBlue

const colorDeepMagenta

const colorBlue

const colorGrey

const colorGreen

const colorDarkGoldenrod

const colorPeach

const colorBlack

const colorLightGrey

const colorWhite

const colorYellow

const colorOlive

const colorCornflowerBlue

const colorSunsetOrange

const colorTangerine

const colorShamrockGreen

const colorGreenishYellow

const colorDarkGrey

const colorTawny

const colorLemon

const colorLime

const colorPink

const colorSilver

const colorManzGreen

const colorKellyGreen

const colorAnotherGrey

var colorForTask

func pickTaskColor(id uint64) string {}