experiment

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateTemplateReplicasCount

func CalculateTemplateReplicasCount(experiment *v1alpha1.Experiment, template v1alpha1.TemplateSpec) int32

func FilterExperimentsToDelete added in v0.6.0

func FilterExperimentsToDelete(exs []*v1alpha1.Experiment, olderRSs []*appsv1.ReplicaSet) []*v1alpha1.Experiment

FilterExperimentsToDelete returns a list of experiments that should be deleted in the cases where: 1. The experiments has no pod hash label, 2. There is no ReplicaSet with the same pod hash as the experiments 3. The ReplicaSet that has the same pod hash as the experiments has a deletiontimestamp. Note: It is okay to use pod hash for filtering since the experiments's pod hash is originally derived from the new RS. Even if there is a library change during the lifetime of the experiments, the ReplicaSet's pod hash that the experiments references does not change.

func GetAnalysisRunStatus added in v0.6.0

func GetAnalysisRunStatus(exStatus v1alpha1.ExperimentStatus, name string) *v1alpha1.ExperimentAnalysisRunStatus

GetAnalysisRunStatus gets an analysis run status by name

func GetCollisionCountForTemplate added in v0.6.0

func GetCollisionCountForTemplate(experiment *v1alpha1.Experiment, template v1alpha1.TemplateSpec) *int32

func GetCurrentExperiment added in v0.6.0

func GetCurrentExperiment(rollout *v1alpha1.Rollout, exList []*v1alpha1.Experiment) *v1alpha1.Experiment

GetCurrentExperiment grabs the experiment that matches the current rollout

func GetOldExperiments added in v0.6.0

func GetOldExperiments(rollout *v1alpha1.Rollout, exList []*v1alpha1.Experiment) []*v1alpha1.Experiment

GetOldExperiments returns the old experiments from list of experiments.

func GetTemplateStatus added in v0.6.0

func GetTemplateStatus(status v1alpha1.ExperimentStatus, name string) *v1alpha1.TemplateStatus

GetTemplateStatus returns a TemplateStatus by name

func GetTemplateStatusMapping

func GetTemplateStatusMapping(status v1alpha1.ExperimentStatus) map[string]v1alpha1.TemplateStatus

GetTemplateStatusMapping returns a mapping of name to template statuses

func HasFinished

func HasFinished(experiment *v1alpha1.Experiment) bool

func HasRequiredAnalysisRuns added in v0.7.1

func HasRequiredAnalysisRuns(ex *v1alpha1.Experiment) bool

func IsSemanticallyEqual added in v0.6.0

func IsSemanticallyEqual(left, right v1alpha1.ExperimentSpec) bool

IsSemanticallyEqual checks to see if two experiments are semantically equal

func IsTerminating added in v0.6.0

func IsTerminating(experiment *v1alpha1.Experiment) bool

IsTerminating returns whether or not an experiment is terminating, such as its analysis failed, or explicit termination.

func PassedDurations

func PassedDurations(experiment *v1alpha1.Experiment) (bool, time.Duration)

PassedDurations indicates if the experiment has run longer than the duration

func ReplicasetNameFromExperiment added in v0.6.0

func ReplicasetNameFromExperiment(experiment *v1alpha1.Experiment, template v1alpha1.TemplateSpec) string

ReplicasetNameFromExperiment gets the replicaset name based off of the experiment and the template

func RequiredAnalysisRunsSuccessful added in v0.7.0

func RequiredAnalysisRunsSuccessful(ex *v1alpha1.Experiment, exStatus *v1alpha1.ExperimentStatus) bool

RequiredAnalysisRunsSuccessful has at least one required for completition analysis run and it completed successfully

func SetAnalysisRunStatus added in v0.6.0

func SetAnalysisRunStatus(exStatus *v1alpha1.ExperimentStatus, newRunStatus v1alpha1.ExperimentAnalysisRunStatus)

SetAnalysisRunStatus updates the experiment's analysis run status with the new analysis run status

func SetTemplateStatus added in v0.6.0

func SetTemplateStatus(status *v1alpha1.ExperimentStatus, templateStatus v1alpha1.TemplateStatus)

SetTemplateStatus updates the experiment's template status with the new template status

func SortExperimentsByPodHash added in v0.6.0

func SortExperimentsByPodHash(exs []*v1alpha1.Experiment) map[string][]*v1alpha1.Experiment

SortExperimentsByPodHash returns map with a podHash as a key and an array of experiments with that pod hash

func TemplateIsWorse added in v0.6.0

func TemplateIsWorse(current, new v1alpha1.TemplateStatusCode) bool

TemplateIsWorse returns whether or not the new template status is a worser condition than the current.

func Terminate added in v0.6.0

func Terminate(experimentIf rolloutsclient.ExperimentInterface, name string) error

func Worst added in v0.6.0

Worst returns the worst of the supplied status codes

Types

type ExperimentByCreationTimestamp added in v0.6.0

type ExperimentByCreationTimestamp []*v1alpha1.Experiment

ExperimentByCreationTimestamp sorts a list of experiment by creation timestamp (earliest to latest), using their name as a tie breaker.

func (ExperimentByCreationTimestamp) Len added in v0.6.0

func (ExperimentByCreationTimestamp) Less added in v0.6.0

func (o ExperimentByCreationTimestamp) Less(i, j int) bool

func (ExperimentByCreationTimestamp) Swap added in v0.6.0

func (o ExperimentByCreationTimestamp) Swap(i, j int)

Jump to

Keyboard shortcuts

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