collect

package
v4.0.0-...-62d2285 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FinishedSpan

type FinishedSpan struct {
	Span     *monkit.Span
	Err      error
	Panicked bool
	Finish   time.Time
}

FinishedSpan is a Span that has completed and contains information about how it finished.

func CollectSpans

func CollectSpans(ctx context.Context, work func(ctx context.Context)) (spans []*FinishedSpan)

CollectSpans is kind of like WatchForSpans, except that it uses the current span to figure out which trace to collect. It calls work(), then collects from the current trace until work() returns. CollectSpans won't work unless some ancestor function is also monitored and has modified the ctx.

type StartTimeSorter

type StartTimeSorter []*FinishedSpan

StartTimeSorter assists with sorting a slice of FinishedSpans by start time.

func (StartTimeSorter) Len

func (s StartTimeSorter) Len() int

func (StartTimeSorter) Less

func (s StartTimeSorter) Less(i, j int) bool

func (StartTimeSorter) Sort

func (s StartTimeSorter) Sort()

func (StartTimeSorter) Swap

func (s StartTimeSorter) Swap(i, j int)

Jump to

Keyboard shortcuts

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