display

package
v0.0.0-...-318a7e3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run()

Run reads in input, builds a tree of traces then flattens it to then display

Types

type InstrumentationLibrary

type InstrumentationLibrary struct {
	Name    string
	Version string
}

type KeyValue

type KeyValue struct {
	Key   string
	Value Value
}

type Line

type Line struct {
	// contains filtered or unexported fields
}

func NewLine

func NewLine(node *SnapshotNode, rootStart time.Time, writer *tview.TextView) *Line

func (*Line) Draw

func (l *Line) Draw(screen tcell.Screen, x, y, width, unit int) int

type Nodes

type Nodes []*SnapshotNode

func (Nodes) Len

func (n Nodes) Len() int

func (Nodes) Less

func (n Nodes) Less(i, j int) bool

func (Nodes) Swap

func (n Nodes) Swap(i, j int)

type SnapshotNode

type SnapshotNode struct {
	SpanSnapshot *SpanSnapshot
	Children     Nodes
}

SnapshotNode represents the tree of traces. Each trace may have multiple children but a single parent.

func ToTree

func ToTree(spans []*SpanSnapshot) *SnapshotNode

type SpanContext

type SpanContext struct {
	TraceID    string
	SpanID     string
	TraceFlags string
	TraceState interface{} // ???
	Remote     bool
}

type SpanSnapshot

type SpanSnapshot struct {
	SpanContext              SpanContext
	Parent                   SpanContext
	SpanKind                 int
	Name                     string
	StartTime                time.Time
	EndTime                  time.Time
	Attributes               []KeyValue
	MessageEvents            interface{} // ???
	Links                    interface{} // ???
	StatusCode               string
	StatusMessage            string
	DroppedAttributeCount    int
	DroppedMessageEventCount int
	DroppedLinkCount         int
	ChildSpanCount           int
	Resource                 []KeyValue
	InstrumentationLibrary   InstrumentationLibrary
}

SpanSnapshot allows unmarshalling the stdout exporter data. This is based on the output currently returned by the stdout exporter as the structs used by the exporter do not unmarshal back to the same struct. There are no guarantees that this structure won't change in the future.

See https://github.com/open-telemetry/opentelemetry-go/issues/1819#issuecomment-825798804

func Read

func Read(r io.Reader) ([]*SpanSnapshot, error)

type Trace

type Trace struct {
	// contains filtered or unexported fields
}

func NewTrace

func NewTrace(start time.Time, end time.Time, lines []*Line) *Trace

func ToTraces

func ToTraces(node *SnapshotNode, writer *tview.TextView) []*Trace

func (*Trace) Draw

func (t *Trace) Draw(screen tcell.Screen, x, y, width int) int

type TraceGraph

type TraceGraph struct {
	*tview.Box
	// contains filtered or unexported fields
}

TraceGraph implements the tview primative for displaying traces

func NewTraceGraph

func NewTraceGraph(traces []*Trace, text *tview.TextView) *TraceGraph

func (*TraceGraph) Draw

func (t *TraceGraph) Draw(screen tcell.Screen)

func (*TraceGraph) InputHandler

func (t *TraceGraph) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*TraceGraph) MouseHandler

func (t *TraceGraph) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

type Value

type Value struct {
	Type  string
	Value interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳