chaos_experiment_run

package
v0.0.0-...-e15d670 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AverageResScore

type AverageResScore struct {
	ID                  string  `bson:"_id"`
	Avg                 float64 `bson:"avg_resiliency_score"`
	TotalExperimentRuns int     `bson:"total_experiment_runs"`
}

AverageResScore represents the avg_resiliency_score and total_experiment_runs of a experiment

type ChaosData

type ChaosData struct {
	EngineUID              string                  `json:"engineUID"`
	EngineContext          string                  `json:"engine_context"`
	EngineName             string                  `json:"engineName"`
	Namespace              string                  `json:"namespace"`
	ExperimentName         string                  `json:"experimentName"`
	ExperimentStatus       string                  `json:"experimentStatus"`
	LastUpdatedAt          string                  `json:"lastUpdatedAt"`
	ExperimentVerdict      string                  `json:"experimentVerdict"`
	ExperimentPod          string                  `json:"experimentPod"`
	RunnerPod              string                  `json:"runnerPod"`
	ProbeSuccessPercentage string                  `json:"probeSuccessPercentage"`
	FailStep               string                  `json:"failStep"`
	ChaosResult            *chaosTypes.ChaosResult `json:"chaosResult"`
}

ChaosData is the data we get from chaos exporter

type ExecutionData

type ExecutionData struct {
	ExperimentType    string          `json:"experimentType"`
	ExperimentID      string          `json:"experimentID"`
	EventType         string          `json:"eventType"`
	RevisionID        string          `json:"revisionID"`
	UID               string          `json:"uid"`
	Namespace         string          `json:"namespace"`
	Name              string          `json:"name"`
	CreationTimestamp string          `json:"creationTimestamp"`
	Phase             string          `json:"phase"`
	Message           string          `json:"message"`
	StartedAt         string          `json:"startedAt"`
	FinishedAt        string          `json:"finishedAt"`
	Nodes             map[string]Node `json:"nodes"`
}

type ExperimentDetails

type ExperimentDetails struct {
	ID                  string                 `bson:"_id"`
	AverageResScore     []AverageResScore      `bson:"avg_resiliency_score"`
	PercentageChange    float64                `bson:"percentage_change"`
	LatestExperimentRun []experimentRunDetails `bson:"latest_experiment_run"`
}

ExperimentDetails is used to decode mongo cursor consisting of experiment details

type ExperimentRunMetrics

type ExperimentRunMetrics struct {
	ResiliencyScore    float64 `json:"resiliency_score"`
	ExperimentsPassed  int     `json:"experiments_passed"`
	ExperimentsFailed  int     `json:"experiments_failed"`
	ExperimentsAwaited int     `json:"experiments_awaited"`
	ExperimentsStopped int     `json:"experiments_stopped"`
	ExperimentsNA      int     `json:"experiments_na"`
	TotalExperiments   int     `json:"total_experiments"`
}

type ExperimentSyncExternalData

type ExperimentSyncExternalData struct {
	ExperimentID     string    `json:"experiment_id"`
	ExperimentRunID  string    `json:"experiment_run_id"`
	ExperimentRunIDs []*string `json:"experiment_run_ids"`
}

type FaultDetailsForAnalytics

type FaultDetailsForAnalytics struct {
	FaultName   string                     `json:"fault_name"`
	TotalProbes int                        `json:"total_probes"`
	Probes      []ProbeDetailsForAnalytics `json:"probes"`
}

type InfraDetails

type InfraDetails struct {
	InfraID string `json:"infra_id"`
	Version string `json:"version"`
}

type LastRunDetails

type LastRunDetails struct {
	ID                  string              `bson:"_id"`
	AvgResScore         float64             `bson:"avg_resiliency_score"`
	PercentageChange    float64             `bson:"percentage_change"`
	LatestExperimentRun LatestExperimentRun `bson:"latest_experiment_run"`
}

LastRunDetails represents the details of latest experiment run. avg_resiliency_score and percentage_change in resiliency_score of a experiment

type LatestExperimentRun

type LatestExperimentRun struct {
	ExperimentRunID string `bson:"experiment_run_id"`
	// Resiliency score of the experiment
	ResiliencyScore *float64 `bson:"resiliency_score"`
	// Timestamp at which experiment run was last updated
	LastUpdated string `bson:"updated_at"`
	// Phase of the experiment run
	Phase string `bson:"phase"`
}

LatestExperimentRun represents the details of the latest experiment run

type Node

type Node struct {
	Name       string     `json:"name"`
	Phase      string     `json:"phase"`
	Message    string     `json:"message"`
	StartedAt  string     `json:"startedAt"`
	FinishedAt string     `json:"finishedAt"`
	Children   []string   `json:"children"`
	Type       string     `json:"type"`
	ChaosExp   *ChaosData `json:"chaosData,omitempty"`
}

Node represents each node/step data

type ProbeDetailsForAnalytics

type ProbeDetailsForAnalytics struct {
	Name string `json:"probe_name"`
	Type string `json:"probe_type"`
	Mode string `json:"probe_mode"`
}

type Service

type Service interface {
	ProcessExperimentRunDelete(ctx context.Context, query bson.D, workflowRunID *string, experimentRun dbChaosExperimentRun.ChaosExperimentRun, workflow dbChaosExperiment.ChaosExperimentRequest, username string, r *store.StateData) error
	ProcessCompletedExperimentRun(execData ExecutionData, wfID string, runID string) (ExperimentRunMetrics, error)
	ProcessExperimentRunStop(ctx context.Context, query bson.D, experimentRunID *string, experiment dbChaosExperiment.ChaosExperimentRequest, username string, projectID string, r *store.StateData) error
}

func NewChaosExperimentRunService

func NewChaosExperimentRunService(chaosWorkflowOperator *dbChaosExperiment.Operator, clusterOperator *dbChaosInfra.Operator, chaosExperimentRunOperator *dbChaosExperimentRun.Operator) Service

NewChaosExperimentRunService returns a new instance of the chaos workflow run service

type StopExperimentInputs

type StopExperimentInputs struct {
	ExperimentName   string   `json:"experiment_name"`
	ExperimentID     string   `json:"experiment_id"`
	ExperimentRunIDs []string `json:"experiment_run_ids"`
}

Directories

Path Synopsis
model

Jump to

Keyboard shortcuts

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