tasks

package
v0.0.0-...-5000e08 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOptionalTimeoutCh

func NewOptionalTimeoutCh(timeoutStr string) (<-chan time.Time, error)

func NonLocalIfaceNames

func NonLocalIfaceNames() ([]string, error)

func OptionsType

func OptionsType(taskOpts Options) string

Types

type ControlNetOptions

type ControlNetOptions struct {
	Type    string
	Timeout string // Times may be suffixed with ms,s,m,h

	// slow: tc qdisc add dev eth0 root netem delay 50ms 10ms distribution normal
	Delay          string
	DelayVariation string

	// flaky: tc qdisc add dev eth0 root netem loss 20% 75%
	Loss            string
	LossCorrelation string
}

See http://www.linuxfoundation.org/collaborate/workgroups/networking/netem

type ControlNetTask

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

func NewControlNetTask

func NewControlNetTask(cmdRunner boshsys.CmdRunner, opts ControlNetOptions, _ boshlog.Logger) ControlNetTask

func (ControlNetTask) Execute

func (t ControlNetTask) Execute(stopCh chan struct{}) error

type FillDiskOptions

type FillDiskOptions struct {
	Type string

	// By default root disk will be filled
	Persistent bool
	Ephemeral  bool
	Temporary  bool
}

type FillDiskTask

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

func NewFillDiskTask

func NewFillDiskTask(cmdRunner boshsys.CmdRunner, opts FillDiskOptions, _ boshlog.Logger) FillDiskTask

func (FillDiskTask) Execute

func (t FillDiskTask) Execute(stopCh chan struct{}) error

type FirewallOptions

type FirewallOptions struct {
	Type    string
	Timeout string // Times may be suffixed with ms,s,m,h

	BlockBOSHAgent bool
}

type FirewallTask

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

func NewFirewallTask

func NewFirewallTask(
	cmdRunner boshsys.CmdRunner,
	opts FirewallOptions,
	allowedOutputDest []FirewallTaskDest,
	_ boshlog.Logger,
) FirewallTask

func (FirewallTask) Execute

func (t FirewallTask) Execute(stopCh chan struct{}) error

type FirewallTaskDest

type FirewallTaskDest struct {
	Host string
	Port int

	IsBOSHMbus bool
}

type KillOptions

type KillOptions struct {
	Type string
}

todo should not be an agent task

type KillProcessOptions

type KillProcessOptions struct {
	Type string

	// Optionally specify any process pattern used with pkill;
	// takes precedence over monitored processes
	ProcessName string

	// Optionally specify monitored process name
	MonitoredProcessName string
}

type KillProcessTask

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

func NewKillProcessTask

func NewKillProcessTask(
	monitClient monit.Client,
	cmdRunner boshsys.CmdRunner,
	opts KillProcessOptions,
	logger boshlog.Logger,
) KillProcessTask

func (KillProcessTask) Execute

func (t KillProcessTask) Execute(stopCh chan struct{}) error

type NoopOptions

type NoopOptions struct {
	Type      string
	Stoppable bool
}

type NoopTask

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

func NewNoopTask

func NewNoopTask(opts NoopOptions) NoopTask

func (NoopTask) Execute

func (t NoopTask) Execute(stopCh chan struct{}) error

type Options

type Options interface {
	// contains filtered or unexported methods
}

type OptionsSlice

type OptionsSlice []Options

func (OptionsSlice) MarshalJSON

func (s OptionsSlice) MarshalJSON() ([]byte, error)

func (*OptionsSlice) UnmarshalJSON

func (s *OptionsSlice) UnmarshalJSON(data []byte) error

type Repo

type Repo interface {
	QueueAndWait(string, []Task) error
	Consume(string) ([]Task, error)

	Wait(string) (ResultRequest, error)
	Update(string, ResultRequest) error

	FetchState(string) (State, error)
	UpdateState(string, StateRequest) error
}

func NewRepo

func NewRepo(logger boshlog.Logger) Repo

type ResultRequest

type ResultRequest struct {
	Error string
}

type ShutdownOptions

type ShutdownOptions struct {
	Type string

	// By default system will be powered off
	Reboot bool
	Force  bool

	Crash bool
	Sysrq string
}

type ShutdownTask

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

func NewShutdownTask

func NewShutdownTask(cmdRunner boshsys.CmdRunner, opts ShutdownOptions, _ boshlog.Logger) ShutdownTask

func (ShutdownTask) Execute

func (t ShutdownTask) Execute(_ chan struct{}) error

type State

type State struct {
	Stop bool
}

type StateRequest

type StateRequest struct {
	Stop bool
}

type StateResponse

type StateResponse struct {
	Stop bool
}

type StressOptions

type StressOptions struct {
	Type    string
	Timeout string // Times may be suffixed with s,m,h,d,y

	NumCPUWorkers int
	NumIOWorkers  int

	NumMemoryWorkers  int
	MemoryWorkerBytes string // Sizes may be suffixed with B,K,M,G

	NumHDDWorkers  int
	HDDWorkerBytes string // Sizes may be suffixed with B,K,M,G
}

type StressTask

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

func NewStressTask

func NewStressTask(cmdRunner boshsys.CmdRunner, opts StressOptions, logger boshlog.Logger) StressTask

func (StressTask) Execute

func (t StressTask) Execute(stopCh chan struct{}) error

type Task

type Task struct {
	ID string

	Optionss OptionsSlice // todo shoudl be singular
}

func (Task) Options

func (t Task) Options() Options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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