Documentation
¶
Index ¶
- Constants
- type ChaosLogger
- func (l *ChaosLogger) Close()
- func (l *ChaosLogger) LogCooldownSkip(remaining float64)
- func (l *ChaosLogger) LogError(message string)
- func (l *ChaosLogger) LogInjection(event InjectionEvent)
- func (l *ChaosLogger) LogMaxDownSkip(downContainers []string)
- func (l *ChaosLogger) LogStart(cfg *config.ChaosConfig)
- func (l *ChaosLogger) LogStop(cycleCount, injectionCount int)
- type EngineState
- type EventRecord
- type InjectionEvent
- type StateManager
- func (s *StateManager) Clear() error
- func (s *StateManager) EnsureDir() error
- func (s *StateManager) IsAlive(pid int) bool
- func (s *StateManager) LogFile() string
- func (s *StateManager) Read() (*EngineState, error)
- func (s *StateManager) RunningPID() *int
- func (s *StateManager) StateFile() string
- func (s *StateManager) Write(data *EngineState) error
Constants ¶
View Source
const ( StateDirName = ".entropy" StateFileName = "state.json" LogFileName = "engine.log" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChaosLogger ¶
type ChaosLogger struct {
// contains filtered or unexported fields
}
func NewChaosLogger ¶
func NewChaosLogger(logFilePath, format string) (*ChaosLogger, error)
func (*ChaosLogger) Close ¶
func (l *ChaosLogger) Close()
func (*ChaosLogger) LogCooldownSkip ¶
func (l *ChaosLogger) LogCooldownSkip(remaining float64)
func (*ChaosLogger) LogError ¶
func (l *ChaosLogger) LogError(message string)
func (*ChaosLogger) LogInjection ¶
func (l *ChaosLogger) LogInjection(event InjectionEvent)
func (*ChaosLogger) LogMaxDownSkip ¶
func (l *ChaosLogger) LogMaxDownSkip(downContainers []string)
func (*ChaosLogger) LogStart ¶
func (l *ChaosLogger) LogStart(cfg *config.ChaosConfig)
func (*ChaosLogger) LogStop ¶
func (l *ChaosLogger) LogStop(cycleCount, injectionCount int)
type EngineState ¶
type EngineState struct {
PID int `json:"pid"`
StartedAt time.Time `json:"started_at"`
ConfigPath string `json:"config_path"`
DryRun bool `json:"dry_run"`
CycleCount int `json:"cycle_count"`
DownContainers []string `json:"down_containers"`
CooldownRemaining float64 `json:"cooldown_remaining"`
CooldownTotal int `json:"cooldown_total"`
LastEvent *EventRecord `json:"last_event"`
History []EventRecord `json:"history"`
}
type EventRecord ¶
type InjectionEvent ¶
type StateManager ¶
type StateManager struct {
// contains filtered or unexported fields
}
func NewStateManager ¶
func NewStateManager(cwd string) *StateManager
func (*StateManager) Clear ¶
func (s *StateManager) Clear() error
func (*StateManager) EnsureDir ¶
func (s *StateManager) EnsureDir() error
func (*StateManager) IsAlive ¶
func (s *StateManager) IsAlive(pid int) bool
func (*StateManager) LogFile ¶
func (s *StateManager) LogFile() string
func (*StateManager) Read ¶
func (s *StateManager) Read() (*EngineState, error)
func (*StateManager) RunningPID ¶
func (s *StateManager) RunningPID() *int
func (*StateManager) StateFile ¶
func (s *StateManager) StateFile() string
func (*StateManager) Write ¶
func (s *StateManager) Write(data *EngineState) error
Click to show internal directories.
Click to hide internal directories.