Documentation ¶
Index ¶
- func SetExperimentLabel(key, value string) yaml.Filter
- func SetExperimentName(name string) yaml.Filter
- func SetNamespace(namespace string) yaml.Filter
- type ApplicationSelector
- type BuiltInPrometheus
- type ContainerResourcesSelector
- type CustomSource
- type DatadogMetricsSource
- type DurationMetricsSource
- type ExperimentSource
- type LocustSource
- type MetricSource
- type ParameterNamer
- type ParameterSource
- type PatchSource
- type PrometheusMetricsSource
- type ReplicaSelector
- type RequestsMetricsSource
- type StormForgerSource
- type Transformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetExperimentLabel ¶
SetExperimentLabel is a filter that sets a label on an experiment object.
func SetExperimentName ¶
SetExperimentName sets the name on the experiment. In addition, the experiment name is set as a suffix on any generated cluster roles or cluster role bindings.
func SetNamespace ¶
SetNamespace sets the namespace on a resource (if necessary).
Types ¶
type ApplicationSelector ¶
type ApplicationSelector struct { Application *redskyappsv1alpha1.Application Scenario *redskyappsv1alpha1.Scenario Objective *redskyappsv1alpha1.Objective }
ApplicationSelector is responsible for "scanning" the application definition itself.
func (*ApplicationSelector) Map ¶
func (s *ApplicationSelector) Map(*yaml.RNode, yaml.ResourceMeta) ([]interface{}, error)
Map ignores inputs (it should just be the null node from select) and produces additional markers for transform.
type BuiltInPrometheus ¶
type BuiltInPrometheus struct { SetupTaskName string ClusterRoleName string ServiceAccountName string ClusterRoleBindingName string scan.ObjectSlice }
func (*BuiltInPrometheus) Update ¶
func (p *BuiltInPrometheus) Update(exp *redskyv1beta1.Experiment) error
type ContainerResourcesSelector ¶
type ContainerResourcesSelector struct { scan.GenericSelector // Path to the list of containers. Path string `json:"path,omitempty"` // Create container resource specifications even if the original object does not contain them. CreateIfNotPresent bool `json:"create,omitempty"` // Regular expression matching the container name. ContainerName string `json:"containerName,omitempty"` // Names of the resources to select, defaults to ["memory", "cpu"]. Resources []corev1.ResourceName `json:"resources,omitempty"` }
ContainerResourcesSelector scans for container resources specifications (requests/limits).
func (*ContainerResourcesSelector) Map ¶
func (s *ContainerResourcesSelector) Map(node *yaml.RNode, meta yaml.ResourceMeta) ([]interface{}, error)
Map inspects the supplied resource for container resources specifications.
type CustomSource ¶
type CustomSource struct { Scenario *redskyappsv1alpha1.Scenario Objective *redskyappsv1alpha1.Objective Application *redskyappsv1alpha1.Application }
func (*CustomSource) Metrics ¶
func (s *CustomSource) Metrics() ([]redskyv1beta1.Metric, error)
func (*CustomSource) Update ¶
func (s *CustomSource) Update(exp *redskyv1beta1.Experiment) error
type DatadogMetricsSource ¶
type DatadogMetricsSource struct {
Goal *redskyappsv1alpha1.Goal
}
func (*DatadogMetricsSource) Metrics ¶
func (s *DatadogMetricsSource) Metrics() ([]redskyv1beta1.Metric, error)
type DurationMetricsSource ¶
type DurationMetricsSource struct {
Goal *redskyappsv1alpha1.Goal
}
func (*DurationMetricsSource) Metrics ¶
func (s *DurationMetricsSource) Metrics() ([]redskyv1beta1.Metric, error)
type ExperimentSource ¶
type ExperimentSource interface {
Update(exp *redskyv1beta1.Experiment) error
}
ExperimentSource allows selectors to modify the experiment directly. Note that for adding parameters, patches, or metrics, the appropriate source should be used instead.
type LocustSource ¶
type LocustSource struct { Scenario *redskyappsv1alpha1.Scenario Objective *redskyappsv1alpha1.Objective Application *redskyappsv1alpha1.Application }
func (*LocustSource) Metrics ¶
func (s *LocustSource) Metrics() ([]redskyv1beta1.Metric, error)
func (*LocustSource) Update ¶
func (s *LocustSource) Update(exp *redskyv1beta1.Experiment) error
type MetricSource ¶
type MetricSource interface {
Metrics() ([]redskyv1beta1.Metric, error)
}
MetricSource allows selectors to contribute metrics to an experiment.
type ParameterNamer ¶
type ParameterNamer func(meta yaml.ResourceMeta, path []string, name string) string
ParameterNamer is used to compute the name of an optimization parameter.
type ParameterSource ¶
type ParameterSource interface {
Parameters(name ParameterNamer) ([]redskyv1beta1.Parameter, error)
}
ParameterSource allows selectors to add parameters to an experiment. In general PatchSources should also be ParameterSources to ensure the parameters used in the generated patches are configured on the experiment.
type PatchSource ¶
type PatchSource interface { TargetRef() *corev1.ObjectReference Patch(name ParameterNamer) (yaml.Filter, error) }
PatchSource allows selectors to contribute changes to the patch of a particular resource. In general, ParameterSource should also be implemented to add any parameters referenced by the generated patches.
type PrometheusMetricsSource ¶
type PrometheusMetricsSource struct {
Goal *redskyappsv1alpha1.Goal
}
func (*PrometheusMetricsSource) Metrics ¶
func (s *PrometheusMetricsSource) Metrics() ([]redskyv1beta1.Metric, error)
type ReplicaSelector ¶
type ReplicaSelector struct { scan.GenericSelector // Path to the replica field. Path string `json:"path,omitempty"` // Create container resource specifications even if the original object does not contain them. CreateIfNotPresent bool `json:"create,omitempty"` }
ReplicaSelector identifies zero or more replica specifications.
func (*ReplicaSelector) Map ¶
func (s *ReplicaSelector) Map(node *yaml.RNode, meta yaml.ResourceMeta) ([]interface{}, error)
type RequestsMetricsSource ¶
type RequestsMetricsSource struct {
Goal *redskyappsv1alpha1.Goal
}
func (*RequestsMetricsSource) Metrics ¶
func (s *RequestsMetricsSource) Metrics() ([]redskyv1beta1.Metric, error)
type StormForgerSource ¶
type StormForgerSource struct { Scenario *redskyappsv1alpha1.Scenario Objective *redskyappsv1alpha1.Objective Application *redskyappsv1alpha1.Application }
func (*StormForgerSource) Metrics ¶
func (s *StormForgerSource) Metrics() ([]redskyv1beta1.Metric, error)
func (*StormForgerSource) Update ¶
func (s *StormForgerSource) Update(exp *redskyv1beta1.Experiment) error
type Transformer ¶
type Transformer struct { // Flag indicating the all of the resources that were scanned should also be included in the output. IncludeApplicationResources bool }
Transformer is used to convert all of the output from the selectors, only selector output matching the "*Source" interfaces are supported.