jobsupervisor

package
v2.32.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: Apache-2.0 Imports: 17 Imported by: 126

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUVitals

type CPUVitals struct {
	Total float64 `json:"total"`
}

type Health

type Health struct {
	State string `json:"state"`
}

type JobFailureHandler

type JobFailureHandler func(boshalert.MonitAlert) error

type JobSupervisor

type JobSupervisor interface {
	Reload() error

	// Actions taken on all services
	Start() error
	Stop() error
	StopAndWait() error

	// Start and Stop should still function after Unmonitor.
	// Calling Start after Unmonitor should re-monitor all jobs.
	// Calling Stop after Unmonitor should not re-monitor all jobs.
	// (Monit complies to above requirements.)
	Unmonitor() error

	Status() string
	Processes() ([]Process, error)
	// Job management
	AddJob(jobName string, jobIndex int, configPath string) error
	RemoveAllJobs() error

	MonitorJobFailures(handler JobFailureHandler) error
	HealthRecorder(status string)
}

func NewDummyJobSupervisor

func NewDummyJobSupervisor() JobSupervisor

func NewDummyNatsJobSupervisor

func NewDummyNatsJobSupervisor(mbusHandler boshhandler.Handler) JobSupervisor

func NewMonitJobSupervisor

func NewMonitJobSupervisor(
	fs boshsys.FileSystem,
	runner boshsys.CmdRunner,
	client boshmonit.Client,
	logger boshlog.Logger,
	dirProvider boshdir.Provider,
	jobFailuresServerPort int,
	reloadOptions MonitReloadOptions,
	timeService clock.Clock,
) JobSupervisor

func NewWrapperJobSupervisor

func NewWrapperJobSupervisor(delegate JobSupervisor, fs system.FileSystem, dirProvider directories.Provider, logger boshlog.Logger) JobSupervisor

type MemoryVitals

type MemoryVitals struct {
	Kb      int     `json:"kb,omitempty"`
	Percent float64 `json:"percent"`
}

type MonitReloadOptions

type MonitReloadOptions struct {
	// Number of times `monit reload` will be executed
	MaxTries int

	// Number of times monit incarnation will be checked
	// for difference after executing `monit reload`
	MaxCheckTries int

	// Length of time between checking for incarnation difference
	DelayBetweenCheckTries time.Duration
}

type Process

type Process struct {
	Name   string       `json:"name"`
	State  string       `json:"state"`
	Uptime UptimeVitals `json:"uptime,omitempty"`
	Memory MemoryVitals `json:"mem,omitempty"`
	CPU    CPUVitals    `json:"cpu,omitempty"`
}

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(
	platform boshplatform.Platform,
	client boshmonit.Client,
	logger boshlog.Logger,
	dirProvider boshdir.Provider,
	handler boshhandler.Handler,
) (p Provider)

func (Provider) Get

func (p Provider) Get(name string) (supervisor JobSupervisor, err error)

type UptimeVitals

type UptimeVitals struct {
	Secs int `json:"secs,omitempty"`
}

Directories

Path Synopsis
monitfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
syslog
Package syslog provides a simple interface to the system log service.
Package syslog provides a simple interface to the system log service.
Package winsvc implements service management functions for the Windows Job Supervisor.
Package winsvc implements service management functions for the Windows Job Supervisor.

Jump to

Keyboard shortcuts

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