Help us shape the future of Go! Take the 2026 Go Developer Survey

stats

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyEventStats

type ApplyEventStats struct {
	// EventByOp tracks the number of ApplyType events including no error by ApplyEventOperation
	// Possible values: Created, Configured, Unchanged.
	EventByOp map[event.ApplyEventStatus]uint64
}

ApplyEventStats tracks the stats for all the ApplyType events

func (*ApplyEventStats) Add

func (s *ApplyEventStats) Add(status event.ApplyEventStatus)

Add records a new event

func (*ApplyEventStats) Empty

func (s *ApplyEventStats) Empty() bool

Empty returns true if no events were recorded.

func (*ApplyEventStats) Set

func (s *ApplyEventStats) Set(status event.ApplyEventStatus, count uint64)

Set records a total number of events

func (ApplyEventStats) String

func (s ApplyEventStats) String() string

String returns the stats as a human readable string.

type DeleteEventStats

type DeleteEventStats struct {
	// EventByOp tracks the number of DeleteType events including no error by DeleteEventOperation
	EventByOp map[event.DeleteEventStatus]uint64
}

DeleteEventStats tracks the stats for all the DeleteType events

func (*DeleteEventStats) Add

func (s *DeleteEventStats) Add(status event.DeleteEventStatus)

Add records a new event

func (*DeleteEventStats) Empty

func (s *DeleteEventStats) Empty() bool

Empty returns true if no events were recorded.

func (*DeleteEventStats) Set

func (s *DeleteEventStats) Set(status event.DeleteEventStatus, count uint64)

Set records a total number of events

func (DeleteEventStats) String

func (s DeleteEventStats) String() string

String returns the stats as a human readable string.

type DisabledObjStats

type DisabledObjStats struct {
	// Total tracks the number of objects to be disabled
	Total uint64
	// Succeeded tracks how many ojbects were disabled successfully
	Succeeded uint64
}

DisabledObjStats tracks the stats for dsiabled objects

func (*DisabledObjStats) Empty

func (s *DisabledObjStats) Empty() bool

Empty returns true if no events were recorded.

func (DisabledObjStats) String

func (s DisabledObjStats) String() string

String returns the stats as a human readable String.

type PruneEventStats

type PruneEventStats struct {
	// EventByOp tracks the number of PruneType events including no error by PruneEventOperation
	EventByOp map[event.PruneEventStatus]uint64
}

PruneEventStats tracks the stats for all the PruneType events

func (*PruneEventStats) Add

func (s *PruneEventStats) Add(status event.PruneEventStatus)

Add records a new event

func (*PruneEventStats) Empty

func (s *PruneEventStats) Empty() bool

Empty returns true if no events were recorded.

func (*PruneEventStats) Set

func (s *PruneEventStats) Set(status event.PruneEventStatus, count uint64)

Set records a total number of events

func (PruneEventStats) String

func (s PruneEventStats) String() string

String returns the stats as a human readable string.

type SyncStats

type SyncStats struct {
	ApplyEvent  *ApplyEventStats
	PruneEvent  *PruneEventStats
	DeleteEvent *DeleteEventStats
	WaitEvent   *WaitEventStats
	DisableObjs *DisabledObjStats
	// ErrorTypeEvents tracks the number of ErrorType events
	ErrorTypeEvents uint64
}

SyncStats tracks the stats for all the events

func NewSyncStats

func NewSyncStats() *SyncStats

NewSyncStats constructs a SyncStats with empty event maps.

func (*SyncStats) Empty

func (s *SyncStats) Empty() bool

Empty returns true if no events were recorded.

func (SyncStats) String

func (s SyncStats) String() string

String returns the stats as a human readable string.

func (*SyncStats) WithApplyEvents

func (s *SyncStats) WithApplyEvents(status event.ApplyEventStatus, count uint64) *SyncStats

WithApplyEvents sets the number of times this apply event status occurred. Intended for easy test expectation construction.

func (*SyncStats) WithDeleteEvents

func (s *SyncStats) WithDeleteEvents(status event.DeleteEventStatus, count uint64) *SyncStats

WithDeleteEvents sets the number of times this delete event status occurred. Intended for easy test expectation construction.

func (*SyncStats) WithDisabledObjStats

func (s *SyncStats) WithDisabledObjStats(total, succeeded uint64) *SyncStats

WithDisabledObjStats sets the disabled object stats. Intended for easy test expectation construction.

func (*SyncStats) WithErrorEvents

func (s *SyncStats) WithErrorEvents(count uint64) *SyncStats

WithErrorEvents sets the total number of error events. Intended for easy test expectation construction.

func (*SyncStats) WithPruneEvents

func (s *SyncStats) WithPruneEvents(status event.PruneEventStatus, count uint64) *SyncStats

WithPruneEvents sets the number of times this prune event status occurred. Intended for easy test expectation construction.

func (*SyncStats) WithWaitEvent

func (s *SyncStats) WithWaitEvent(status event.WaitEventStatus, count uint64) *SyncStats

WithWaitEvent sets the number of times this wait event status occurred. Intended for easy test expectation construction.

type WaitEventStats

type WaitEventStats struct {
	// EventByOp tracks the number of WaitType events including no error by WaitTypeOperation
	// Possible values: Pending, Successful, Skipped, Timeout, Failed
	EventByOp map[event.WaitEventStatus]uint64
}

WaitEventStats tracks the stats for all the WaitType events

func (*WaitEventStats) Add

func (s *WaitEventStats) Add(status event.WaitEventStatus)

Add records a new event

func (*WaitEventStats) Empty

func (s *WaitEventStats) Empty() bool

Empty returns true if no events were recorded.

func (*WaitEventStats) Set

func (s *WaitEventStats) Set(status event.WaitEventStatus, count uint64)

Set records a total number of events

func (WaitEventStats) String

func (s WaitEventStats) String() string

String returns the stats as a human readable string.

Jump to

Keyboard shortcuts

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