idtui

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	InitVertex    = "init"
	PrimaryVertex = "primary"
)
View Source
const (
	TooFastThreshold = 100 * time.Millisecond
	GCThreshold      = 1 * time.Second
)

Variables

This section is empty.

Functions

func VertexClasses added in v0.9.9

func VertexClasses(vtx *progrock.Vertex) string

func WalkSteps added in v0.9.9

func WalkSteps(steps []*Step, f func(*TraceRow))

func Zoomed added in v0.9.9

Zoomed marks the vertex as zoomed, indicating it should take up as much screen space as possible.

Types

type DB added in v0.9.9

type DB struct {
	Epoch, End time.Time

	IDs       map[string]*call.ID
	Vertices  map[string]*progrock.Vertex
	Tasks     map[string][]*progrock.VertexTask
	Outputs   map[string]map[string]struct{}
	OutputOf  map[string]map[string]struct{}
	Children  map[string]map[string]struct{}
	Intervals map[string]map[time.Time]*progrock.Vertex
}

func NewDB added in v0.9.9

func NewDB() *DB

func (*DB) Close added in v0.9.9

func (*DB) Close() error

func (*DB) HighLevelStep added in v0.9.9

func (db *DB) HighLevelStep(id *call.ID) (*Step, bool)

func (*DB) MostInterestingVertex added in v0.9.11

func (db *DB) MostInterestingVertex(dig string) *progrock.Vertex

func (*DB) Simplify added in v0.9.9

func (db *DB) Simplify(dig string) string

func (*DB) Step added in v0.9.9

func (db *DB) Step(dig string) (*Step, bool)

Step returns a Step for the given digest if and only if the step should be displayed.

Currently this means:

- We don't show `id` selections, since that would be way too much noise. - We don't show internal non-ID vertices, since they're not interesting. - We DO show internal ID vertices, since they're currently marked internal just to hide them from the old TUI.

func (*DB) WriteStatus added in v0.9.9

func (db *DB) WriteStatus(status *progrock.StatusUpdate) error

type Frontend

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

	// Plain tells the frontend to render plain console output instead of using a
	// TUI. This will be automatically set to true if a TTY is not found.
	Plain bool

	// Silent tells the frontend to not display progress at all.
	Silent bool
	// contains filtered or unexported fields
}

func New

func New() *Frontend

func (*Frontend) Close

func (fe *Frontend) Close() error

func (*Frontend) ConnectedToCloud added in v0.9.9

func (fe *Frontend) ConnectedToCloud(cloudURL string)

ConnectedToCloud is called when the CLI has started emitting events to The Cloud.

func (*Frontend) ConnectedToEngine added in v0.9.9

func (fe *Frontend) ConnectedToEngine(name string)

ConnectedToEngine is called when the CLI connects to an engine.

func (*Frontend) DumpID added in v0.9.9

func (fe *Frontend) DumpID(out *termenv.Output, id *call.ID) error

DumpID is exposed for troubleshooting.

func (*Frontend) Init added in v0.9.9

func (fe *Frontend) Init() tea.Cmd

func (*Frontend) Render

func (fe *Frontend) Render(out *termenv.Output) error

func (*Frontend) Run added in v0.9.9

func (fe *Frontend) Run(ctx context.Context, run func(context.Context) error) error

Run starts the TUI, calls the run function, stops the TUI, and finally prints the primary output to the appropriate stdout/stderr streams.

func (*Frontend) Update added in v0.9.9

func (fe *Frontend) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Frontend) View added in v0.9.9

func (fe *Frontend) View() string

func (*Frontend) WriteStatus

func (fe *Frontend) WriteStatus(update *progrock.StatusUpdate) error

type LogsView added in v0.10.0

type LogsView struct {
	Primary *Step
	Body    []*TraceRow
	Init    *TraceRow
}

func CollectLogsView added in v0.10.0

func CollectLogsView(rows []*TraceRow) *LogsView

type Pipeline added in v0.9.9

type Pipeline []*TraceRow

func CollectPipelines added in v0.10.0

func CollectPipelines(rows []*TraceRow) []Pipeline

type Span added in v0.9.9

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

func (Span) Bar added in v0.9.9

func (span Span) Bar() templ.Component

type Step added in v0.9.9

type Step struct {
	BaseDigest string
	Digest     string
	// contains filtered or unexported fields
}

func CollectSteps added in v0.9.9

func CollectSteps(db *DB) []*Step

func (*Step) Base added in v0.9.9

func (step *Step) Base() (*Step, bool)

func (*Step) Children added in v0.9.9

func (step *Step) Children() []*Step

func (*Step) Duration added in v0.9.9

func (step *Step) Duration() time.Duration

func (*Step) EndTime added in v0.9.9

func (step *Step) EndTime() time.Time

func (*Step) Err added in v0.9.9

func (step *Step) Err() error

func (*Step) FirstCompleted added in v0.9.9

func (step *Step) FirstCompleted() *time.Time

func (*Step) HasStarted added in v0.9.9

func (step *Step) HasStarted() bool

func (*Step) ID added in v0.9.9

func (step *Step) ID() *call.ID

func (*Step) Inputs added in v0.9.9

func (step *Step) Inputs() []string

func (*Step) IsBefore added in v0.9.9

func (step *Step) IsBefore(other *Step) bool

func (*Step) IsInternal added in v0.9.9

func (step *Step) IsInternal() bool

func (*Step) IsRunning added in v0.9.9

func (step *Step) IsRunning() bool

func (*Step) MostInterestingVertex added in v0.10.0

func (step *Step) MostInterestingVertex() *progrock.Vertex

func (*Step) Name added in v0.9.9

func (step *Step) Name() string

func (*Step) Spans added in v0.9.9

func (step *Step) Spans() (spans []Span)

func (*Step) StartTime added in v0.9.9

func (step *Step) StartTime() time.Time

type TraceRow added in v0.9.9

type TraceRow struct {
	Step *Step

	Parent *TraceRow

	IsRunning bool
	Chained   bool

	Children  []*TraceRow
	Collapsed bool
}

func CollectRows added in v0.9.9

func CollectRows(steps []*Step) []*TraceRow

func (*TraceRow) Depth added in v0.9.9

func (row *TraceRow) Depth() int

func (*TraceRow) IsInteresting added in v0.9.9

func (row *TraceRow) IsInteresting() bool

type Vterm added in v0.9.9

type Vterm struct {
	Offset int
	Height int
	Width  int

	Prefix string
	// contains filtered or unexported fields
}

func NewVterm added in v0.9.9

func NewVterm() *Vterm

func (*Vterm) Init added in v0.9.9

func (term *Vterm) Init() tea.Cmd

func (*Vterm) LastLine added in v0.9.9

func (term *Vterm) LastLine() string

LastLine returns the last line of visible text, with ANSI formatting, but without any trailing whitespace.

func (*Vterm) Print added in v0.9.9

func (term *Vterm) Print(w io.Writer) error

Print prints the full log output without any formatting.

func (*Vterm) Render added in v0.9.9

func (term *Vterm) Render(w io.Writer, offset, height int)

Bytes returns the output for the given region of the terminal, with ANSI formatting.

func (*Vterm) ScrollPercent added in v0.9.9

func (term *Vterm) ScrollPercent() float64

func (*Vterm) SetHeight added in v0.9.9

func (term *Vterm) SetHeight(height int)

func (*Vterm) SetPrefix added in v0.9.9

func (term *Vterm) SetPrefix(prefix string)

func (*Vterm) SetWidth added in v0.9.9

func (term *Vterm) SetWidth(width int)

func (*Vterm) Term added in v0.9.9

func (term *Vterm) Term() *midterm.Terminal

func (*Vterm) Update added in v0.9.9

func (term *Vterm) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Vterm) UsedHeight added in v0.9.9

func (term *Vterm) UsedHeight() int

func (*Vterm) View added in v0.9.9

func (term *Vterm) View() string

View returns the output for the current region of the terminal, with ANSI formatting.

func (*Vterm) Write added in v0.9.9

func (term *Vterm) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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