Documentation ¶
Overview ¶
Package schedule implements a schedule of terminations
Index ¶
- type ByTime
- type Entry
- type Schedule
- func (s *Schedule) Add(tm time.Time, group grp.InstanceGroup)
- func (s Schedule) Crontab(exPath string, account string) []byte
- func (s *Schedule) Entries() []Entry
- func (s Schedule) MarshalJSON() ([]byte, error)
- func (s *Schedule) Populate(d deploy.Deployment, getter chaosmonkey.AppConfigGetter, ...) error
- func (s *Schedule) UnmarshalJSON(b []byte) (err error)
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
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 ¶
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) UnmarshalJSON ¶
UnmarshalJSON implements Unmarshaler.UnmarshalJSON
type Schedule ¶
type Schedule struct {
// contains filtered or unexported fields
}
Schedule is a collection of termination entries.
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 ¶
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) MarshalJSON ¶
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 ¶
UnmarshalJSON implements Unmarshaler.UnmarshalJSON