Documentation ¶
Index ¶
- type AggregatedExperimentRunStats
- type AggregatedExperimentRuns
- type AggregatedExperimentStats
- type AggregatedExperiments
- type AggregatedExperimentsWithProbes
- type AvgResScore
- type CategorizedExperimentRunStats
- type ChaosExperimentRequest
- type ChaosExperimentType
- type ChaosExperimentsWithRunDetails
- type ExperimentDetails
- type ExperimentRevision
- type ExperimentRunDetail
- type FaultEventMetadata
- type FlattenedExperimentRun
- type GetExperimentDetails
- type Operator
- func (c *Operator) CountChaosExperiments(ctx context.Context, query bson.D) (int64, error)
- func (c *Operator) GetAggregateExperiments(pipeline mongo.Pipeline) (*mongo.Cursor, error)
- func (c *Operator) GetExperiment(ctx context.Context, query bson.D) (ChaosExperimentRequest, error)
- func (c *Operator) GetExperiments(query bson.D) ([]ChaosExperimentRequest, error)
- func (c *Operator) GetExperimentsByInfraID(infraID string) ([]ChaosExperimentRequest, error)
- func (c *Operator) InsertChaosExperiment(ctx context.Context, chaosExperiment ChaosExperimentRequest) error
- func (c *Operator) UpdateChaosExperiment(ctx context.Context, query bson.D, update bson.D, ...) error
- func (c *Operator) UpdateChaosExperiments(ctx context.Context, query bson.D, update bson.D) error
- type ProbeAnnotations
- type Probes
- type ProbesMatched
- type TotalFilteredData
- type WeightagesInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregatedExperimentRuns ¶
type AggregatedExperimentRuns struct { TotalFilteredExperimentRuns []TotalFilteredData `bson:"total_filtered_experiment_runs"` FlattenedExperimentRuns []FlattenedExperimentRun `bson:"flattened_experiment_runs"` }
type AggregatedExperimentStats ¶
type AggregatedExperimentStats struct { TotalExperiments []TotalFilteredData `bson:"total_experiments"` TotalFilteredExperiments []CategorizedExperimentRunStats `bson:"categorized_by_resiliency_score"` }
type AggregatedExperiments ¶
type AggregatedExperiments struct { TotalFilteredExperiments []TotalFilteredData `bson:"total_filtered_experiments"` ScheduledExperiments []ChaosExperimentsWithRunDetails `bson:"scheduled_experiments"` }
type AggregatedExperimentsWithProbes ¶
type AggregatedExperimentsWithProbes struct { TotalFilteredExperiments []TotalFilteredData `bson:"total_filtered_experiments"` ScheduledExperiments []ChaosExperimentsWithRunDetails `bson:"scheduled_experiments"` ProbesMatched []ProbesMatched `bson:"probes_matched"` }
type AvgResScore ¶
AvgResScore contains average resiliency score
type ChaosExperimentRequest ¶
type ChaosExperimentRequest struct { mongodb.ResourceDetails `bson:",inline"` mongodb.Audit `bson:",inline"` ProjectID string `bson:"project_id"` ExperimentID string `bson:"experiment_id"` CronSyntax string `bson:"cron_syntax"` InfraID string `bson:"infra_id"` ExperimentType ChaosExperimentType `bson:"experiment_type"` Revision []ExperimentRevision `bson:"revision"` IsCustomExperiment bool `bson:"is_custom_experiment"` RecentExperimentRunDetails []ExperimentRunDetail `bson:"recent_experiment_run_details"` // stores the details of last 10 experiment runs TotalExperimentRuns int `bson:"total_experiment_runs"` }
ChaosExperimentRequest contains the required fields to be stored in the database for a chaos experiment input
type ChaosExperimentType ¶
type ChaosExperimentType string
const ( NonCronExperiment ChaosExperimentType = "experiment" CronExperiment ChaosExperimentType = "cronexperiment" ChaosEngine ChaosExperimentType = "chaosengine" )
type ChaosExperimentsWithRunDetails ¶
type ChaosExperimentsWithRunDetails struct { mongodb.ResourceDetails `bson:",inline"` mongodb.Audit `bson:",inline"` ProjectID string `bson:"project_id"` ExperimentID string `bson:"experiment_id"` CronSyntax string `bson:"cron_syntax"` Revision []ExperimentRevision `bson:"revision"` ExperimentType ChaosExperimentType `bson:"experiment_type"` KubernetesInfraDetails []chaos_infrastructure.ChaosInfra `bson:"kubernetesInfraDetails"` LastExperimentRunDetails []chaos_experiment_run.ChaosExperimentRun `bson:"lastExpRunDetails"` RecentExperimentRunDetails []ExperimentRunDetail `bson:"recent_experiment_run_details"` // stores the details of last 10 experiment runs TotalExperimentRuns int `bson:"total_experiment_runs"` AvgResScore float64 `bson:"avg_resiliency_score"` IsCustomExperiment bool `bson:"is_custom_experiment"` IsRemoved bool `bson:"is_removed"` }
ChaosExperimentsWithRunDetails contains the required fields to be stored in the database for a chaos experiment input
type ExperimentDetails ¶
type ExperimentDetails struct { ExperimentType ChaosExperimentType `bson:"experiment_type"` ExperimentName string `bson:"name"` IsCustomExperiment bool `bson:"is_custom_experiment"` Revision []ExperimentRevision `bson:"revision"` }
type ExperimentRevision ¶
type ExperimentRevision struct { RevisionID string `bson:"revision_id"` ExperimentManifest string `bson:"experiment_manifest"` UpdatedAt int64 `bson:"updated_at"` Weightages []*WeightagesInput `bson:"weightages"` Probes []Probes `bson:"probes"` }
type ExperimentRunDetail ¶
type ExperimentRunDetail struct { mongodb.Audit `bson:",inline"` ProjectID string `bson:"project_id"` ExperimentRunID string `bson:"experiment_run_id"` Phase string `bson:"phase"` NotifyID *string `bson:"notify_id"` ResiliencyScore *float64 `bson:"resiliency_score,omitempty"` Completed bool `bson:"completed"` RunSequence int `bson:"run_sequence"` Probe []Probes `bson:"probes"` }
type FaultEventMetadata ¶
type FlattenedExperimentRun ¶
type FlattenedExperimentRun struct { mongodb.Audit `bson:",inline"` ProjectID string `bson:"project_id"` ExperimentID string `bson:"experiment_id"` ExperimentRunID string `bson:"experiment_run_id"` CronSyntax string `bson:"cron_syntax"` ExecutionData string `bson:"execution_data"` RevisionID string `bson:"revision_id"` InfraID string `bson:"infra_id"` Phase string `bson:"phase"` NotifyID *string `bson:"notify_id"` KubernetesInfraDetails []chaos_infrastructure.ChaosInfra `bson:"kubernetesInfraDetails,omitempty"` ExperimentDetails []ExperimentDetails `bson:"experiment"` ResiliencyScore *float64 `bson:"resiliency_score,string,omitempty"` FaultsPassed *int `bson:"faults_passed,string,omitempty"` FaultsFailed *int `bson:"faults_failed,string,omitempty"` FaultsAwaited *int `bson:"faults_awaited,string,omitempty"` FaultsStopped *int `bson:"faults_stopped,string,omitempty"` FaultsNA *int `bson:"faults_na,string,omitempty"` TotalFaults *int `bson:"total_faults,string,omitempty"` IsCustomExperiment bool `bson:"is_custom_experiment"` Completed bool `bson:"completed"` IsRemoved bool `bson:"is_removed"` RunSequence int64 `bson:"run_sequence"` }
type GetExperimentDetails ¶
type GetExperimentDetails struct { ChaosExperimentsWithRunDetails `bson:"inline"` AvgResiliencyScore []AvgResScore `bson:"avg_resiliency_score"` }
GetExperimentDetails contains details to be returned by GetExperiment handler
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
Operator is the model for cluster collection
func NewChaosExperimentOperator ¶
func NewChaosExperimentOperator(mongodbOperator mongodb.MongoOperator) *Operator
NewChaosExperimentOperator returns a new instance of Operator
func (*Operator) CountChaosExperiments ¶
CountChaosExperiments returns total number of matched documents
func (*Operator) GetAggregateExperiments ¶
GetAggregateExperiments takes a mongo pipeline to retrieve the experiment details from the database
func (*Operator) GetExperiment ¶
GetExperiment takes a query parameter to retrieve the experiment details from the database
func (*Operator) GetExperiments ¶
func (c *Operator) GetExperiments(query bson.D) ([]ChaosExperimentRequest, error)
GetExperiments takes a query parameter to retrieve the experiment details from the database
func (*Operator) GetExperimentsByInfraID ¶
func (c *Operator) GetExperimentsByInfraID(infraID string) ([]ChaosExperimentRequest, error)
GetExperimentsByInfraID takes a infraID parameter to retrieve the experiment details from the database
func (*Operator) InsertChaosExperiment ¶
func (c *Operator) InsertChaosExperiment(ctx context.Context, chaosExperiment ChaosExperimentRequest) error
InsertChaosExperiment takes details of a experiment and inserts into the database collection
type ProbeAnnotations ¶
type Probes ¶
type Probes struct { FaultName string `bson:"fault_name" json:"faultName"` ProbeNames []string `bson:"probe_names" json:"probeNames"` }
Probes details containing fault name and the probe name which it was mapped to
type ProbesMatched ¶
type TotalFilteredData ¶
type TotalFilteredData struct {
Count int `bson:"count"`
}
type WeightagesInput ¶
type WeightagesInput struct { FaultName string `bson:"fault_name"` Weightage int `bson:"weightage"` }
WeightagesInput contains the required fields to be stored in the database for a weightages input