monitor

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeProgress

func EncodeProgress(progressList []Progress) *protocol.PushProgressRequest

func Fail

func Fail(ctx context.Context, err error)

Types

type Monitor

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

func NewTracer

func NewTracer(name string) *Monitor

func (*Monitor) List

func (t *Monitor) List() []Progress

func (*Monitor) Start

func (t *Monitor) Start(ctx context.Context, name string, total int) (context.Context, *Span)

Start creates a root span.

type Progress

type Progress struct {
	Tracer     string
	Name       string
	Status     Status
	Error      string
	Count      int
	Total      int
	StartTime  time.Time
	FinishTime time.Time
}

func DecodeProgress

func DecodeProgress(in *protocol.PushProgressRequest) []Progress

type Span

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

func Start

func Start(ctx context.Context, name string, total int) (context.Context, *Span)

func (*Span) Add

func (s *Span) Add(n int)

func (*Span) Count

func (s *Span) Count() int

func (*Span) End

func (s *Span) End()

func (*Span) Fail

func (s *Span) Fail(err error)

func (*Span) Progress

func (s *Span) Progress() Progress

type Status

type Status string
const (
	StatusPending   Status = "Pending"
	StatusComplete  Status = "Complete"
	StatusRunning   Status = "Running"
	StatusSuspended Status = "Suspended"
	StatusFailed    Status = "Failed"
)

Jump to

Keyboard shortcuts

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