analysis

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildExecutionRequest added in v0.0.2

func BuildExecutionRequest(ctx ExecutionRequestContext) (*kayenta.ExecutionRequest, error)

func BuildScope added in v0.0.2

func BuildScope(control, experiment string) (*kayenta.Scope, error)

func UpdateScopes

func UpdateScopes(scopes []kayenta.Scope, scope, startTimeIso, endTimeIso string, controlOffset time.Duration) []kayenta.Scope

UpdateScopes is a helper function that will replace the values in an ExecRequest to produce the proper request

func WaitForComplete

func WaitForComplete(ctx context.Context, executionID string, client kayenta.StandaloneCanaryAnalysisAPI, ticker *time.Ticker, progressFunc ProgressFunc) error

WaitForComplete this issues a call out to kayenta and then loops as it waits for it to finish. Likely we'll have to refactor the call signature to inject dependencies, for example, a ticker perhaps should live otuside of this function progressFunc is called on ever interval where the execution is not complete. if the execution is complete, progressFunc will not be called and the function will terminate.

Types

type ExecutionRequestContext added in v0.0.2

type ExecutionRequestContext struct {
	ControlScope, ExperimentScope string
	StartTimeIso, EndTimeIso      string

	ControlOffset                              time.Duration
	AnalysisIntervalMins, LifetimeDurationMins time.Duration

	Thresholds kayenta.Threshold
}

type GraphicalProgressPrinter

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

GraphicalProgressPrinter implements a kayenta.ProgressFunc that outputs the analysis of an analysis while we wait for the final result

func NewDefaultGraphicalProgressPrinter

func NewDefaultGraphicalProgressPrinter() *GraphicalProgressPrinter

func (*GraphicalProgressPrinter) PrintProgress

func (*GraphicalProgressPrinter) Start

func (pp *GraphicalProgressPrinter) Start()

func (*GraphicalProgressPrinter) Stop

func (pp *GraphicalProgressPrinter) Stop()

type ProgressFunc

type ProgressFunc func(res kayenta.GetStandaloneCanaryAnalysisOutput)

Jump to

Keyboard shortcuts

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