report

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttemptReport

type AttemptReport struct {
	State             AttemptState
	StartAt, FinishAt time.Time
	PlanError         *TimedError
	Filesystems       []*FilesystemReport
}

func (*AttemptReport) BytesSum

func (self *AttemptReport) BytesSum() (expected, replicated uint64,
	invalidSizeEstimates bool,
)

func (*AttemptReport) FilesystemsByState

func (self *AttemptReport) FilesystemsByState() map[FilesystemState][]*FilesystemReport

func (*AttemptReport) FilesystemsProgress

func (self *AttemptReport) FilesystemsProgress() (expected, replicated int)

func (*AttemptReport) IsTerminal

func (self *AttemptReport) IsTerminal() bool

func (*AttemptReport) SortFilesystems

func (self *AttemptReport) SortFilesystems() []*FilesystemReport

type AttemptState

type AttemptState string
const (
	AttemptPlanning      AttemptState = "planning"
	AttemptPlanningError AttemptState = "planning-error"
	AttemptFanOutFSs     AttemptState = "fan-out-filesystems"
	AttemptFanOutError   AttemptState = "filesystem-error"
	AttemptDone          AttemptState = "done"
)

func (AttemptState) IsTerminal

func (a AttemptState) IsTerminal() bool

Returns true in case the AttemptState is a terminal state(AttemptPlanningError, AttemptFanOutError, AttemptDone)

type FilesystemInfo

type FilesystemInfo struct {
	Name string
}

type FilesystemReport

type FilesystemReport struct {
	Info *FilesystemInfo

	State FilesystemState

	// Always valid.
	BlockedOn FsBlockedOn

	// Valid in State = FilesystemPlanningErrored
	PlanError *TimedError
	// Valid in State = FilesystemSteppingErrored
	StepError *TimedError

	// Valid in State = FilesystemStepping
	CurrentStep int
	Steps       []*StepReport
}

func (*FilesystemReport) BytesSum

func (self *FilesystemReport) BytesSum() (expected, replicated uint64,
	containsInvalidSizeEstimates bool,
)

func (*FilesystemReport) Error

func (self *FilesystemReport) Error() *TimedError

func (*FilesystemReport) NextStep

func (self *FilesystemReport) NextStep() *StepReport

may return nil

func (*FilesystemReport) Running

func (self *FilesystemReport) Running() bool

func (*FilesystemReport) Step

func (self *FilesystemReport) Step() *StepReport

type FilesystemState

type FilesystemState string
const (
	FilesystemPlanning        FilesystemState = "planning"
	FilesystemPlanningErrored FilesystemState = "planning-error"
	FilesystemStepping        FilesystemState = "stepping"
	FilesystemSteppingErrored FilesystemState = "step-error"
	FilesystemDone            FilesystemState = "done"
)

type FsBlockedOn

type FsBlockedOn string
const (
	FsBlockedOnNothing           FsBlockedOn = "nothing"
	FsBlockedOnPlanningStepQueue FsBlockedOn = "plan-queue"
	FsBlockedOnParentInitialRepl FsBlockedOn = "parent-initial-repl"
	FsBlockedOnReplStepQueue     FsBlockedOn = "repl-queue"
)

type Report

type Report struct {
	StartAt, FinishAt                      time.Time
	WaitReconnectSince, WaitReconnectUntil time.Time
	WaitReconnectError                     *TimedError
	Attempts                               []*AttemptReport
}

func (*Report) Error

func (r *Report) Error() string

func (*Report) GetFailedFilesystemsCountInLatestAttempt

func (r *Report) GetFailedFilesystemsCountInLatestAttempt() int

Returns, for the latest replication attempt, 0 if there have not been any replication attempts, -1 if the replication failed while enumerating file systems N if N filesystems could not not be replicated successfully

func (*Report) Progress

func (r *Report) Progress() (uint64, uint64)

func (*Report) Running

func (r *Report) Running() (d time.Duration, ok bool)

type StepInfo

type StepInfo struct {
	From, To        string
	Resumed         bool
	BytesExpected   uint64
	BytesReplicated uint64
}

type StepReport

type StepReport struct {
	Info *StepInfo
}

func (*StepReport) IsIncremental

func (f *StepReport) IsIncremental() bool

type TimedError

type TimedError struct {
	Err  string
	Time time.Time
}

func NewTimedError

func NewTimedError(err string, t time.Time) *TimedError

func (*TimedError) Error

func (s *TimedError) Error() string

Jump to

Keyboard shortcuts

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