trace

package
v0.0.0-...-c97221a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppTopicTraceEvent represents event topic for Trace events
	AppTopicTraceEvent = "Trace"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	ID       string
	Key      string
	Duration time.Duration
}

Event represents a published Trace event.

type Tracer

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

Tracer represents tracer which records stages durations. It can be used to record stages times for tracing how long it took time.

func NewTracer

func NewTracer(name string) *Tracer

NewTracer returns new tracer instance.

func (*Tracer) EndStage

func (t *Tracer) EndStage(key string)

EndStage ends tracing stage for given key.

func (*Tracer) Finish

func (t *Tracer) Finish(eventPublisher eventbus.Publisher, id string) string

Finish finishes tracing and returns formatted string with stages durations.

func (*Tracer) StartStage

func (t *Tracer) StartStage(key string) string

StartStage starts tracing stage for given key.

Jump to

Keyboard shortcuts

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