Skip to content

Commit

Permalink
feat(standalone-canary-analysis): allow specifying a control offset i…
Browse files Browse the repository at this point in the history
…n standalone kayenta
  • Loading branch information
AbdulRahman AlHamali authored and fieldju committed Dec 21, 2020
1 parent 6b387f3 commit b66d60b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ public class CanaryAnalysisExecutionRequestScope {
example = "us-west-2")
String controlLocation;

@ApiModelProperty(
value =
"The time offset (in minutes) to apply to the control scope. If none is provided, the control is "
+ "evaluated at the same time as the experiment.",
example = "10")
@Builder.Default
Long controlOffset = 0L;

@ApiModelProperty(
value =
"This value is used to fetch the data for the experiment from the metrics service. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ protected Map<String, CanaryScopePair> buildRequestScopes(
new CanaryScope(
scope.getControlScope(),
scope.getControlLocation(),
scopeTimeConfig.start,
scopeTimeConfig.start.minus(Duration.ofMinutes(scope.getControlOffset())),
scopeTimeConfig.end,
config.getStep().getSeconds(),
scope.getExtendedScopeParams());
Expand Down

0 comments on commit b66d60b

Please sign in to comment.