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 java.lang.Object implements com.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilderThis StageExecution setups up the canary execution stages and executes / monitors them. This StageExecution will trigger the GenerateCanaryAnalysisResultStage always.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSTAGE_DESCRIPTIONstatic java.lang.StringSTAGE_TYPE
-
Constructor Summary
Constructors Constructor Description SetupAndExecuteCanariesStage(java.time.Clock clock, com.fasterxml.jackson.databind.ObjectMapper kayentaObjectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterStages(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)protected java.util.Map<java.lang.String,com.netflix.kayenta.canary.CanaryScopePair>buildRequestScopes(CanaryAnalysisExecutionRequest config, long interval, java.time.Duration intervalDuration)protected java.time.DurationcalculateAnalysisInterval(CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest, java.time.Duration lifetime)Calculates the how often a canary judgement should be performed during the lifetime of the canary analysis execution.protected java.time.DurationcalculateLifetime(java.time.Instant start, java.time.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, java.time.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.java.lang.StringgetType()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, wait
-
-
-
-
Field Detail
-
STAGE_TYPE
public static final java.lang.String STAGE_TYPE
- See Also:
- Constant Field Values
-
STAGE_DESCRIPTION
public static final java.lang.String STAGE_DESCRIPTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 java.time.Duration calculateLifetime(java.time.Instant start, java.time.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 java.time.Duration calculateAnalysisInterval(CanaryAnalysisExecutionRequest canaryAnalysisExecutionRequest, java.time.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 java.util.Map<java.lang.String,com.netflix.kayenta.canary.CanaryScopePair> buildRequestScopes(CanaryAnalysisExecutionRequest config, long interval, java.time.Duration intervalDuration)
-
calculateStartAndEndForJudgement
protected com.netflix.kayenta.standalonecanaryanalysis.orca.stage.SetupAndExecuteCanariesStage.ScopeTimeConfig calculateStartAndEndForJudgement(CanaryAnalysisExecutionRequest config, long judgementNumber, java.time.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
@Nonnull public java.lang.String getType()
- Specified by:
getTypein interfacecom.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder
-
-