report

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 2 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 (a *AttemptReport) BytesSum() (expected, replicated uint64, containsInvalidSizeEstimates bool)

func (*AttemptReport) FilesystemsByState

func (f *AttemptReport) FilesystemsByState() map[FilesystemState][]*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 added in v0.6.1

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 (f *FilesystemReport) BytesSum() (expected, replicated uint64, containsInvalidSizeEstimates bool)

func (*FilesystemReport) Error

func (f *FilesystemReport) Error() *TimedError

func (*FilesystemReport) NextStep

func (f *FilesystemReport) NextStep() *StepReport

may return nil

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 added in v0.5.0

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) GetFailedFilesystemsCountInLatestAttempt added in v0.3.0

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

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