v1alpha2

package
v1.0.0-preview Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CandidateAssessment

type CandidateAssessment struct {
	VersionAssessment `json:",inline"`
	// A flag indicates whether traffic to this candidate should be cutoff
	Rollback bool `json:"rollback"`
}

CandidateAssessment contains assessment for a candidate

func (*CandidateAssessment) DeepCopy

func (in *CandidateAssessment) DeepCopy() *CandidateAssessment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CandidateAssessment.

func (*CandidateAssessment) DeepCopyInto

func (in *CandidateAssessment) DeepCopyInto(out *CandidateAssessment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CounterMetric

type CounterMetric struct {
	// Unique identifier
	Name string `json:"name"`

	// Direction indicating which values are "better"
	//+kubebuilder:validation:Enum={lower,higher}
	PreferredDirection *string `json:"preferred_direction,omitempty"`

	// Descriptive short name
	DescriptiveShortName *string `json:"descriptive_short_name,omitempty"`

	// Query template of this metric
	QueryTemplate string `json:"query_template"`
}

CounterMetric is the definition of Counter Metric

type Criterion

type Criterion struct {
	ID        string     `json:"id"`
	MetricID  string     `json:"metric_id"`
	IsReward  *bool      `json:"is_reward,omitempty"`
	Threshold *Threshold `json:"threshold,omitempty"`
}

Criterion includes an assessment details for each version

type CriterionAssessment

type CriterionAssessment struct {
	// Id of version
	ID string `json:"id"`

	// ID of metric
	MetricID string `json:"metric_id"`

	//Statistics for this metric
	Statistics *Statistics `json:"statistics,omitempty"`

	// Assessment of how well this metric is doing with respect to threshold.
	// Defined only for metrics with a threshold
	ThresholdAssessment *ThresholdAssessment `json:"threshold_assessment,omitempty"`
}

CriterionAssessment contains assessment for a version

func (*CriterionAssessment) DeepCopy

func (in *CriterionAssessment) DeepCopy() *CriterionAssessment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CriterionAssessment.

func (*CriterionAssessment) DeepCopyInto

func (in *CriterionAssessment) DeepCopyInto(out *CriterionAssessment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Interval

type Interval struct {
	Lower float32 `json:"lower"`
	Upper float32 `json:"upper"`
}

Interval for probability

type Metrics

type Metrics struct {
	CounterMetrics []CounterMetric `json:"counter_metrics"`
	RatioMetrics   []RatioMetric   `json:"ratio_metrics"`
}

Metrics details

type RatioMetric

type RatioMetric struct {
	// Unique identifier
	Name string `json:"name"`

	// Direction indicating which values are "better"
	//+kubebuilder:validation:Enum={lower,higher}
	PreferredDirection *string `json:"preferred_direction,omitempty"`

	// Descriptive short name
	DescriptiveShortName *string `json:"descriptive_short_name,omitempty"`

	// Counter metric used in numerator
	Numerator string `json:"numerator"`

	// Counter metric used in denominator
	Denominator string `json:"denominator"`

	// Boolean flag indicating if the value of this metric is always in the range 0 to 1
	// +optional
	ZeroToOne *bool `json:"zero_to_one,omitempty"`
}

RatioMetric is the definiton of Ratio Metric

type RatioStatistics

type RatioStatistics struct {
	ImprovementOverBaseline       Interval `json:"improvement_over_baseline"`
	ProbabilityOfBeatingBaseline  float32  `json:"probability_of_beating_baseline"`
	ProbabilityOfBeingBestVersion float32  `json:"probability_of_being_best_version"`
	CredibleInterval              Interval `json:"credible_interval"`
}

RatioStatistics is statistics for a ratio metric

func (*RatioStatistics) DeepCopy

func (in *RatioStatistics) DeepCopy() *RatioStatistics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RatioStatistics.

func (*RatioStatistics) DeepCopyInto

func (in *RatioStatistics) DeepCopyInto(out *RatioStatistics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Request

type Request struct {
	// Name of experiment
	Name string `json:"name"`

	// ISO8601 timestamp for the beginning of the time range of interest
	StartTime string `json:"start_time"`

	// Name of the service
	ServiceName string `json:"service_name"`

	// Current iteration of the experiment
	IterationNumber *int32 `json:"iteration_number,omitempty"`

	// All metric specification
	MetricSpecs Metrics `json:"metric_specs"`

	// Criteria to be assessed for each version in this experiment
	Criteria []Criterion `json:"criteria"`

	// Baseline verison details
	Baseline Version `json:"baseline"`

	// Candidate versions details
	Candidate []Version `json:"candidates"`

	// State returned by the server on the previous call
	LastState interface{} `json:"last_state,omitempty"`

	// Parameters controlling the behavior of the analytics
	TrafficControl *TrafficControl `json:"traffic_control,omitempty"`
}

Request defines payload to analytics service

type Response

type Response struct {
	// Timestamp when assessment is made
	Timestamp string `json:"timestamp"`

	// Assessment for baseline
	BaselineAssessment VersionAssessment `json:"baseline_assessment"`

	// Assessment for candidates
	CandidateAssessments []CandidateAssessment `json:"candidate_assessments"`

	// TrafficSplitRecommendation contains traffic split recommendations for versions from each algorithm
	// The map is interprted as {name_of_algorithm: {name_of_version: traffic_amount}}
	TrafficSplitRecommendation map[string]map[string]int32 `json:"traffic_split_recommendation"`

	// Assessment for winner
	WinnerAssessment `json:"winner_assessment"`

	// Status of analytics engine
	Status *[]string `json:"status,omitempty"`

	// Human-readable explanation of the status
	StatusInterpretations *map[string]string `json:"status_interpretations,omitempty"`

	// Last recorded state from analytics service
	LastState *interface{} `json:"last_state,omitempty"`
}

Response from analytics

type Statistics

type Statistics struct {
	Value           *float32         `json:"value,omitempty"`
	RatioStatistics *RatioStatistics `json:"ratio_statitics,omitempty"`
}

Statistics for a metric

func (*Statistics) DeepCopy

func (in *Statistics) DeepCopy() *Statistics

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Statistics.

func (*Statistics) DeepCopyInto

func (in *Statistics) DeepCopyInto(out *Statistics)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Threshold

type Threshold struct {
	Type  string  `json:"threshold_type"`
	Value float32 `json:"value"`
}

Threshold details

type ThresholdAssessment

type ThresholdAssessment struct {
	// A flag indicating whether threshold is breached
	ThresholdBreached bool `json:"threshold_breached"`
	// Probability of satisfying the threshold.
	// Defined only for ratio metrics. This is currently computed based on Bayesian estimation
	ProbabilityOfSatisfyingTHreshold float32 `json:"probability_of_satisfying_threshold"`
}

ThresholdAssessment is the assessment for a threshold

func (*ThresholdAssessment) DeepCopy

func (in *ThresholdAssessment) DeepCopy() *ThresholdAssessment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ThresholdAssessment.

func (*ThresholdAssessment) DeepCopyInto

func (in *ThresholdAssessment) DeepCopyInto(out *ThresholdAssessment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TrafficControl

type TrafficControl struct {
	// Maximum possible increment in a candidate's traffic during the initial phase of the experiment
	MaxIncrement float32 `json:"max_increment"`

	// Traffic split algorithm to use during the experiment
	Strategy string `json:"strategy"`
}

TrafficControl details

type Version

type Version struct {
	// Name of the version
	ID string `json:"id"`

	// labels for the version
	VersionLabels map[string]string `json:"version_labels"`
}

Version specifies details of a version

type VersionAssessment

type VersionAssessment struct {
	ID                   string                `json:"id"`
	WinProbability       float32               `json:"win_probability"`
	RequestCount         int32                 `json:"request_count"`
	CriterionAssessments []CriterionAssessment `json:"criterion_assessments,omitempty"`
}

VersionAssessment contains assessment details for a version

func (*VersionAssessment) DeepCopy

func (in *VersionAssessment) DeepCopy() *VersionAssessment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionAssessment.

func (*VersionAssessment) DeepCopyInto

func (in *VersionAssessment) DeepCopyInto(out *VersionAssessment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WinnerAssessment

type WinnerAssessment struct {
	// Indicates whether or not a clear winner has emerged
	// This is currently computed based on Bayesian estimation and uses posterior_probability_for_winner from the iteration parameters
	WinnerFound bool `json:"winning_version_found"`

	// ID of the current winner with the maximum probability of winning.
	// This is currently computed based on Bayesian estimation
	Winner string `json:"current_best_version,omitempty"`

	//Posterior probability of the version declared as the current winner.
	// This is None if winner is None. This is currently computed based on Bayesian estimation
	Probability float32 `json:"probability_of_winning_for_best_version,omitempty"`
}

WinnerAssessment contains assessment for a winner version

func (*WinnerAssessment) DeepCopy

func (in *WinnerAssessment) DeepCopy() *WinnerAssessment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WinnerAssessment.

func (*WinnerAssessment) DeepCopyInto

func (in *WinnerAssessment) DeepCopyInto(out *WinnerAssessment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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