monitor

package
v1.0.58 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2017 License: GPL-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event string

Event represents the event picked up by the monitor.

const (
	// EventStart is the event generated when a PU starts.
	EventStart Event = "start"

	// EventStop is the event generated when a PU stops/dies.
	EventStop Event = "stop"

	// EventCreate is the event generated when a PU gets created.
	EventCreate Event = "create"

	// EventDestroy is the event generated when a PU is definitely removed.
	EventDestroy Event = "destroy"

	// EventPause is the event generated when a PU is set to pause.
	EventPause Event = "pause"

	// EventUnpause is the event generated when a PU is unpaused.
	EventUnpause Event = "unpause"
)

type Monitor

type Monitor interface {

	// Start starts the monitor.
	Start() error

	// Stop Stops the monitor.
	Stop() error
}

A Monitor is the interface to implement low level monitoring functions on some well defined primitive.

type ProcessingUnitsHandler

type ProcessingUnitsHandler interface {

	// SetPURuntime handles the create ProcessingUnit event.
	SetPURuntime(contextID string, runtimeInfo *policy.PURuntime) error

	// HandlePUEvent handles the event generated by the PU.
	HandlePUEvent(contextID string, event Event) error
}

A ProcessingUnitsHandler is responsible for monitoring creation and deletion of ProcessingUnits.

type State

type State int

A State describes the state of the PU.

const (
	// StateStarted is the state of a started PU.
	StateStarted State = iota + 1

	// StateStopped is the state of stopped PU.
	StateStopped

	// StatePaused is the state of a paused PU.
	StatePaused

	// StateDestroyed is the state of destroyed PU.
	StateDestroyed

	// StateUnknwown is the state of PU in an unknown state.
	StateUnknwown
)

type SynchronizationHandler

type SynchronizationHandler interface {

	// HandleSynchronization handles a synchronization routine.
	HandleSynchronization(contextID string, state State, RuntimeReader policy.RuntimeReader, syncType SynchronizationType) error

	// HandleSynchronizationComplete is called when a synchronization job is complete.
	HandleSynchronizationComplete(syncType SynchronizationType)
}

A SynchronizationHandler can handle a PU synchronization routine.

type SynchronizationType

type SynchronizationType int

A SynchronizationType represents the type of synchronization job.

const (
	// SynchronizationTypeInitial indicates the initial synchronization job.
	SynchronizationTypeInitial SynchronizationType = iota + 1

	// SynchronizationTypePeriodic indicates subsequent synchronization jobs.
	SynchronizationTypePeriodic
)

type TestMonitor

type TestMonitor interface {
	Monitor
	MockStart(t *testing.T, impl func() error)
	MockStop(t *testing.T, impl func() error)
}

TestMonitor us

func NewTestMonitor

func NewTestMonitor() TestMonitor

NewTestMonitor returns a new TestManipulator.

Directories

Path Synopsis
mock
nolint
nolint
cgnetcls
Package cgnetcls implements functionality to manage classid for processes belonging to different cgroups
Package cgnetcls implements functionality to manage classid for processes belonging to different cgroups
cgnetcls/mock
nolint
nolint
Automatically generated by MockGen.
Automatically generated by MockGen.

Jump to

Keyboard shortcuts

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