dagui

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HideCompletedVerbosity    = 0
	ShowCompletedVerbosity    = 1
	ExpandCompletedVerbosity  = 2
	ShowInternalVerbosity     = 3
	ShowEncapsulatedVerbosity = 3
	ShowSpammyVerbosity       = 4
	ShowDigestsVerbosity      = 4
)

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(d time.Duration) string

Types

type DB

type DB struct {
	PrimarySpan trace.SpanID
	PrimaryLogs map[trace.SpanID][]sdklog.Record

	Traces        map[trace.TraceID]*Trace
	Spans         map[trace.SpanID]*Span
	SpanOrder     []*Span
	Children      map[trace.SpanID]map[trace.SpanID]struct{}
	ChildrenOrder map[trace.SpanID][]trace.SpanID

	Calls     map[string]*callpbv1.Call
	Outputs   map[string]map[string]struct{}
	OutputOf  map[string]map[string]struct{}
	Intervals map[string]map[time.Time]*Span

	Effects    map[string]*Span
	EffectSite map[string]*Span
}

func NewDB

func NewDB() *DB

func (*DB) AllTraces

func (db *DB) AllTraces() []*Trace

func (*DB) Close

func (*DB) Close() error

func (*DB) CollectTree

func (db *DB) CollectTree(spans []*Span) []*TraceTree

func (*DB) ExportSpans

func (db *DB) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error

func (*DB) ForceFlush

func (db *DB) ForceFlush(ctx context.Context) error

func (*DB) HighLevelSpan

func (db *DB) HighLevelSpan(call *callpbv1.Call) *Span

func (*DB) LogExporter

func (db *DB) LogExporter() sdklog.Exporter

func (*DB) MostInterestingSpan

func (db *DB) MostInterestingSpan(dig string) *Span

func (*DB) MustCall

func (db *DB) MustCall(dig string) *callpbv1.Call

func (*DB) RowsView

func (db *DB) RowsView(zoomedID trace.SpanID) *RowsView

func (*DB) SetPrimarySpan

func (db *DB) SetPrimarySpan(span trace.SpanID)

SetPrimarySpan allows the primary span to be explicitly set to a particular span. normally we assume the root span is the primary span, but in a nested scenario we never actually see the root span, so the CLI explicitly sets it to the span it created.

func (*DB) Shutdown

func (db *DB) Shutdown(ctx context.Context) error

func (*DB) Simplify

func (db *DB) Simplify(call *callpbv1.Call, force bool) (smallest *callpbv1.Call)

func (*DB) WalkSpans

func (db *DB) WalkSpans(spans []*Span, f func(*TraceTree))

type DBLogExporter

type DBLogExporter struct {
	*DB
}

func (DBLogExporter) Export

func (db DBLogExporter) Export(ctx context.Context, logs []sdklog.Record) error

type FrontendOpts

type FrontendOpts struct {
	// Debug tells the frontend to show everything and do one big final render.
	Debug bool

	// Silent tells the frontend to not display progress at all.
	Silent bool

	// Verbosity is the level of detail to show in the TUI.
	Verbosity int

	// Don't show things that completed beneath this duration. (default 100ms)
	TooFastThreshold time.Duration

	// Remove completed things after this duration. (default 1s)
	GCThreshold time.Duration

	// Open web browser with the trace URL as soon as pipeline starts.
	OpenWeb bool

	// RevealAllSpans tells the frontend to show all spans, not just the spans
	// beneath the primary span.
	RevealAllSpans bool

	// Leave the TUI running instead of exiting after completion.
	NoExit bool
}

func (FrontendOpts) ShouldShow

func (opts FrontendOpts) ShouldShow(tree *TraceTree) bool

type Rows

type Rows struct {
	Order  []*TraceRow
	BySpan map[trace.SpanID]*TraceRow
}

type RowsView

type RowsView struct {
	Zoomed *Span
	Body   []*TraceTree
}

func (*RowsView) Rows

func (lv *RowsView) Rows(opts FrontendOpts) *Rows

type Span

type Span struct {
	sdktrace.ReadOnlySpan

	ParentSpan *Span
	ChildSpans []*Span

	ID trace.SpanID

	IsSelfRunning bool

	Digest string
	Call   *callpbv1.Call
	Base   *callpbv1.Call

	Internal bool
	Cached   bool
	Canceled bool
	EffectID string

	Inputs         []string
	Effects        []string
	RunningEffects map[string]*Span
	FailedEffects  map[string]*Span

	Encapsulate  bool
	Encapsulated bool
	Mask         bool
	Passthrough  bool
	Ignore       bool
	// contains filtered or unexported fields
}

func (*Span) ActiveDuration

func (span *Span) ActiveDuration(fallbackEnd time.Time) time.Duration

func (*Span) Bar

func (span *Span) Bar() SpanBar

func (*Span) ChildrenAndEffects

func (span *Span) ChildrenAndEffects() []*Span

func (*Span) Classes

func (span *Span) Classes() string

func (*Span) EffectSpans

func (span *Span) EffectSpans() []*Span

func (*Span) EndTime

func (span *Span) EndTime() time.Time

func (*Span) EndTimeOrFallback

func (span *Span) EndTimeOrFallback(fallbackEnd time.Time) time.Time

func (*Span) Err

func (span *Span) Err() error

func (*Span) Failed

func (span *Span) Failed() bool

func (*Span) HasParent

func (span *Span) HasParent(parent *Span) bool

func (*Span) IsBefore

func (span *Span) IsBefore(other *Span) bool

func (*Span) IsInternal

func (span *Span) IsInternal() bool

func (*Span) IsRunning

func (span *Span) IsRunning() bool

func (*Span) Name

func (span *Span) Name() string

func (*Span) SelfDuration

func (span *Span) SelfDuration(fallbackEnd time.Time) time.Duration

type SpanActivity

type SpanActivity struct {
	Duration time.Duration
	Min      time.Time
	Max      time.Time
}

type SpanBar

type SpanBar struct {
	Span          *Span
	Duration      time.Duration
	OffsetPercent float64
	WidthPercent  float64
}

type Task

type Task struct {
	Span      sdktrace.ReadOnlySpan
	Name      string
	Current   int64
	Total     int64
	Started   time.Time
	Completed time.Time
}

type Trace

type Trace struct {
	ID         trace.TraceID
	Epoch, End time.Time
	IsRunning  bool
	// contains filtered or unexported fields
}

func (*Trace) HexID

func (trace *Trace) HexID() string

type TraceRow

type TraceRow struct {
	Index                   int
	Span                    *Span
	Depth                   int
	IsRunningOrChildRunning bool
}

TraceRow is the flattened representation of the tree so we can easily walk it backwards and render only the parts that will fit on screen. Otherwise large traces get giga slow.

type TraceTree

type TraceTree struct {
	Span *Span

	Parent *TraceTree

	IsRunningOrChildRunning bool
	Chained                 bool

	Children []*TraceTree
}

func (*TraceTree) Depth

func (row *TraceTree) Depth() int

Jump to

Keyboard shortcuts

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