schedule

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2016 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package schedule implements a schedule of terminations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByTime

type ByTime []Entry

ByTime implements sort.Interface for []Entry based on the time field

func (ByTime) Len

func (t ByTime) Len() int

func (ByTime) Less

func (t ByTime) Less(i, j int) bool

func (ByTime) Swap

func (t ByTime) Swap(i, j int)

type Entry

type Entry struct {
	Group grp.InstanceGroup `json:"group"`
	Time  time.Time         `json:"time"`
}

Entry is an entry a termination schedule. It contains the instance group that the terminator will randomly select from as well as the time of termination.

func (*Entry) Crontab

func (e *Entry) Crontab(termPath, account string) string

Crontab returns a termination command for the Entry, in crontab format. It takes as arguments:

  • the path to the termination executable
  • the account that should execute the job

The returned string is not terminated by a newline.

func (*Entry) Equal

func (e *Entry) Equal(o *Entry) bool

Equal checks that two entries are equal

func (*Entry) UnmarshalJSON

func (e *Entry) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements Unmarshaler.UnmarshalJSON

type Schedule

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

Schedule is a collection of termination entries.

func New

func New() *Schedule

New returns a new Schedule

func (*Schedule) Add

func (s *Schedule) Add(tm time.Time, group grp.InstanceGroup)

Add schedules a termination for group at time tm

func (Schedule) Crontab

func (s Schedule) Crontab(exPath string, account string) []byte

Crontab returns a schedule of termination commands in crontab format It takes as arguments:

  • the path to the executable that terminates an instance
  • the account that should execute the job

func (*Schedule) Entries

func (s *Schedule) Entries() []Entry

Entries returns the list of schedule entries

func (Schedule) MarshalJSON

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

MarshalJSON implements Marshaler.MarshalJSON

func (*Schedule) Populate

func (s *Schedule) Populate(d deploy.Deployment, getter chaosmonkey.AppConfigGetter, chaosConfig *config.Monkey, apps []string) error

Populate populates the termination schedule with the random terminations for a list of apps. If the specified list of apps is empty, then it will

func (*Schedule) UnmarshalJSON

func (s *Schedule) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements Unmarshaler.UnmarshalJSON

Jump to

Keyboard shortcuts

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