mock

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Mu            sync.Mutex
	Signals       []string
	Restarts      map[string]int // Supervisor -> count
	ChildRestarts map[string]int // Child -> count
	Backoffs      map[string]time.Duration

	// Additional counters for verification
	SupervisorAdds    map[string]int
	SupervisorRemoves map[string]int
	WorkerStarts      map[string]int
	WorkerStops       map[string]int
	WorkerFails       map[string]int
}

Provider matches metrics.Provider interface for testing. It is safe for concurrent use.

func New

func New() *Provider

func (*Provider) IncBackoffTriggered

func (m *Provider) IncBackoffTriggered(c string, d time.Duration)

func (*Provider) IncChildRestart

func (m *Provider) IncChildRestart(s, c string)

func (*Provider) IncContainerFailed

func (m *Provider) IncContainerFailed(image string)

func (*Provider) IncContainerStarted

func (m *Provider) IncContainerStarted(image string)

func (*Provider) IncContainerStopped

func (m *Provider) IncContainerStopped(image string)

func (*Provider) IncCriticalSectionFinished added in v1.4.0

func (m *Provider) IncCriticalSectionFinished(success bool)

func (*Provider) IncCriticalSectionStarted added in v1.4.0

func (m *Provider) IncCriticalSectionStarted()

func (*Provider) IncForceExitTriggered

func (m *Provider) IncForceExitTriggered()

func (*Provider) IncHookExecuted

func (m *Provider) IncHookExecuted()

func (*Provider) IncHookPanicked

func (m *Provider) IncHookPanicked()

func (*Provider) IncProcessFailed

func (m *Provider) IncProcessFailed()

func (*Provider) IncProcessStarted

func (m *Provider) IncProcessStarted()

func (*Provider) IncSignalReceived

func (m *Provider) IncSignalReceived(sig string)

func (*Provider) IncSupervisorAdd

func (m *Provider) IncSupervisorAdd(s string)

func (*Provider) IncSupervisorRemove

func (m *Provider) IncSupervisorRemove(s string)

func (*Provider) IncSupervisorRestart

func (m *Provider) IncSupervisorRestart(s, strategy string)

func (*Provider) IncTerminalUpgrade

func (m *Provider) IncTerminalUpgrade(success bool)

func (*Provider) IncWorkerFailed

func (m *Provider) IncWorkerFailed(wt string)

func (*Provider) IncWorkerStarted

func (m *Provider) IncWorkerStarted(wt string)

func (*Provider) IncWorkerStopped

func (m *Provider) IncWorkerStopped(wt string)

func (*Provider) ObserveContainerDuration

func (m *Provider) ObserveContainerDuration(image string, d time.Duration)

func (*Provider) ObserveCriticalSectionDuration added in v1.4.0

func (m *Provider) ObserveCriticalSectionDuration(d time.Duration)

func (*Provider) ObserveHookDuration

func (m *Provider) ObserveHookDuration(d time.Duration)

func (*Provider) ObserveShutdownDuration

func (m *Provider) ObserveShutdownDuration(wt string, d time.Duration)

func (*Provider) ObserveWorkerDuration

func (m *Provider) ObserveWorkerDuration(wt string, d time.Duration)

Jump to

Keyboard shortcuts

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