Class SetupAndExecuteCanariesStage
java.lang.Object
com.netflix.kayenta.standalonecanaryanalysis.orca.stage.SetupAndExecuteCanariesStage
- All Implemented Interfaces:
com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint,com.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder,org.pf4j.ExtensionPoint
@Component
public class SetupAndExecuteCanariesStage
extends Object
implements com.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder
This StageExecution setups up the canary execution stages and executes / monitors them. This
StageExecution will trigger the GenerateCanaryAnalysisResultStage always.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder
com.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder.Aliases -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSetupAndExecuteCanariesStage(Clock clock, com.fasterxml.jackson.databind.ObjectMapper kayentaObjectMapper) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterStages(com.netflix.spinnaker.orca.api.pipeline.models.StageExecution parent, com.netflix.spinnaker.orca.api.pipeline.graph.StageGraphBuilder graph) voidbeforeStages(com.netflix.spinnaker.orca.api.pipeline.models.StageExecution parent, com.netflix.spinnaker.orca.api.pipeline.graph.StageGraphBuilder graph) buildRequestScopes(CanaryAnalysisExecutionRequest config, long interval, Duration intervalDuration) protected DurationcalculateAnalysisInterval(CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest, Duration lifetime) Calculates the how often a canary judgement should be performed during the lifetime of the canary analysis execution.protected DurationcalculateLifetime(Instant start, Instant endTime, CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest) Calculates the lifetime duration for the canary analysis execution.protected com.netflix.kayenta.standalonecanaryanalysis.orca.stage.SetupAndExecuteCanariesStage.ScopeTimeConfigcalculateStartAndEndForJudgement(CanaryAnalysisExecutionRequest config, long judgementNumber, Duration judgementDuration) Calculates the start and end timestamps that will be used when querying the metrics sources when doing the canary judgements for each judgement interval.getType()voidonFailureStages(com.netflix.spinnaker.orca.api.pipeline.models.StageExecution parent, com.netflix.spinnaker.orca.api.pipeline.graph.StageGraphBuilder graph) voidtaskGraph(com.netflix.spinnaker.orca.api.pipeline.models.StageExecution stage, com.netflix.spinnaker.orca.api.pipeline.graph.TaskNode.Builder builder) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint
getExtensionClass, getPluginIdMethods inherited from interface com.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder
aliases, buildTaskGraph, canManuallySkip, prepareStageForRestart
-
Field Details
-
STAGE_TYPE
- See Also:
-
STAGE_DESCRIPTION
- See Also:
-
-
Constructor Details
-
SetupAndExecuteCanariesStage
@Autowired public SetupAndExecuteCanariesStage(Clock clock, com.fasterxml.jackson.databind.ObjectMapper kayentaObjectMapper)
-
-
Method Details
-
taskGraph
public void taskGraph(@Nonnull com.netflix.spinnaker.orca.api.pipeline.models.StageExecution stage, @Nonnull com.netflix.spinnaker.orca.api.pipeline.graph.TaskNode.Builder builder) - Specified by:
taskGraphin interfacecom.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder
-
beforeStages
public void beforeStages(@Nonnull com.netflix.spinnaker.orca.api.pipeline.models.StageExecution parent, @Nonnull com.netflix.spinnaker.orca.api.pipeline.graph.StageGraphBuilder graph) - Specified by:
beforeStagesin interfacecom.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder
-
calculateLifetime
protected Duration calculateLifetime(Instant start, Instant endTime, CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest) Calculates the lifetime duration for the canary analysis execution.- Parameters:
start- The calculated start time for the executionendTime- The calculated endtimecanaryAnalysisExecutionRequest- The execution request- Returns:
- The calculated duration of the canary analysis
-
calculateAnalysisInterval
protected Duration calculateAnalysisInterval(CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest, Duration lifetime) Calculates the how often a canary judgement should be performed during the lifetime of the canary analysis execution.- Parameters:
canaryAnalysisExecutionRequest- The execution requestslifetime- The calculated lifetime of the canary analysis execution- Returns:
- How often a judgement should be performed
-
buildRequestScopes
protected Map<String,com.netflix.kayenta.canary.CanaryScopePair> buildRequestScopes(CanaryAnalysisExecutionRequest config, long interval, Duration intervalDuration) -
calculateStartAndEndForJudgement
protected com.netflix.kayenta.standalonecanaryanalysis.orca.stage.SetupAndExecuteCanariesStage.ScopeTimeConfig calculateStartAndEndForJudgement(CanaryAnalysisExecutionRequest config, long judgementNumber, Duration judgementDuration) Calculates the start and end timestamps that will be used when querying the metrics sources when doing the canary judgements for each judgement interval.- Parameters:
judgementNumber- The judgement number / index for the canary analysis executionjudgementDuration- The duration of the judgement windowconfig- The execution request config- Returns:
- A wrapper object containing the start and end times to be used as Instants
-
onFailureStages
public void onFailureStages(@Nonnull com.netflix.spinnaker.orca.api.pipeline.models.StageExecution parent, @Nonnull com.netflix.spinnaker.orca.api.pipeline.graph.StageGraphBuilder graph) - Specified by:
onFailureStagesin interfacecom.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder
-
afterStages
public void afterStages(@Nonnull com.netflix.spinnaker.orca.api.pipeline.models.StageExecution parent, @Nonnull com.netflix.spinnaker.orca.api.pipeline.graph.StageGraphBuilder graph) - Specified by:
afterStagesin interfacecom.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder
-
getType
- Specified by:
getTypein interfacecom.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder
-