chaos_experiment_run

package
v0.0.0-...-bcdb799 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChaosExperimentRun

type ChaosExperimentRun struct {
	ProjectID       string `bson:"project_id"`
	mongodb.Audit   `bson:",inline"`
	InfraID         string   `bson:"infra_id"`
	ExperimentRunID string   `bson:"experiment_run_id"`
	ExperimentID    string   `bson:"experiment_id"`
	ExperimentName  string   `bson:"experiment_name"`
	Phase           string   `bson:"phase"`
	Probes          []Probes `bson:"probes"`
	ExecutionData   string   `bson:"execution_data"`
	RevisionID      string   `bson:"revision_id"`
	NotifyID        *string  `bson:"notify_id"`
	ResiliencyScore *float64 `bson:"resiliency_score,omitempty"`
	FaultsPassed    *int     `bson:"faults_passed,omitempty"`
	FaultsFailed    *int     `bson:"faults_failed,omitempty"`
	FaultsAwaited   *int     `bson:"faults_awaited,omitempty"`
	FaultsStopped   *int     `bson:"faults_stopped,omitempty"`
	FaultsNA        *int     `bson:"faults_na,omitempty"`
	TotalFaults     *int     `bson:"total_faults,omitempty"`
	RunSequence     int      `bson:"run_sequence"`
	Completed       bool     `bson:"completed"`
}

ChaosExperimentRun contains the required fields to be stored in the database for an experiment run

type FlattenedExperimentRun

type FlattenedExperimentRun struct {
	ProjectID        string             `bson:"project_id"`
	InfraID          string             `bson:"infra_id"`
	ExperimentRunID  string             `bson:"experiment_run_id"`
	ExperimentID     string             `bson:"experiment_id"`
	ExperimentName   string             `bson:"experiment_name"`
	CronSyntax       string             `bson:"cronSyntax"`
	Weightages       []*WeightagesInput `bson:"weightages"`
	IsCustomWorkflow bool               `bson:"isCustomWorkflow"`
	UpdatedAt        string             `bson:"updated_at"`
	CreatedAt        string             `bson:"created_at"`
	ExperimentRuns   ChaosExperimentRun `bson:"experiment_runs"`
	IsRemoved        bool               `bson:"isRemoved"`
}

type Operator

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

func NewChaosExperimentRunOperator

func NewChaosExperimentRunOperator(mongodbOperator mongodb.MongoOperator) *Operator

func (*Operator) CountExperimentRuns

func (c *Operator) CountExperimentRuns(ctx context.Context, query bson.D) (int64, error)

func (*Operator) CreateExperimentRun

func (c *Operator) CreateExperimentRun(ctx context.Context, wfRun ChaosExperimentRun) error

func (*Operator) GetAggregateExperimentRuns

func (c *Operator) GetAggregateExperimentRuns(pipeline mongo.Pipeline) (*mongo.Cursor, error)

GetAggregateExperimentRuns takes a mongo pipeline to retrieve the experiment details from the database

func (*Operator) GetExperimentRun

func (c *Operator) GetExperimentRun(query bson.D) (ChaosExperimentRun, error)

func (*Operator) GetExperimentRuns

func (c *Operator) GetExperimentRuns(query bson.D) ([]ChaosExperimentRun, error)

func (*Operator) GetExperimentRunsByInfraID

func (c *Operator) GetExperimentRunsByInfraID(infraID string) ([]ChaosExperimentRun, error)

GetExperimentRunsByInfraID takes a infraID parameter to retrieve the experiment details from the database

func (*Operator) UpdateExperimentRun

func (c *Operator) UpdateExperimentRun(ctx context.Context, wfRun ChaosExperimentRun) (int, error)

UpdateExperimentRun takes experimentID and wfRun parameters to update the experiment run details in the database

func (*Operator) UpdateExperimentRunWithQuery

func (c *Operator) UpdateExperimentRunWithQuery(ctx context.Context, query bson.D, update bson.D) error

func (*Operator) UpdateExperimentRunsWithQuery

func (c *Operator) UpdateExperimentRunsWithQuery(ctx context.Context, query bson.D, update bson.D) error

type Probes

type Probes struct {
	FaultName  string   `bson:"fault_name" json:"faultName"`
	ProbeNames []string `bson:"probe_names" json:"probeNames"`
}

type TotalFilteredData

type TotalFilteredData struct {
	Count int `bson:"count"`
}

type WeightagesInput

type WeightagesInput struct {
	ExperimentName string `bson:"experiment_name"`
	Weightage      int    `bson:"weightage"`
}

Jump to

Keyboard shortcuts

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