monitor

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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