Skip to content

Commit

Permalink
return the metricSetPairList ID in the canary response
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Graff committed Nov 14, 2017
1 parent bf28136 commit 1edc513
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ public class CanaryExecutionStatusResponse {
protected String status;

protected CanaryResult result;

protected String metricSetPairListId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ public CanaryExecutionStatusResponse getCanaryResults(@RequestParam(required = f
.orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + REFID_JUDGE + "' in pipeline ID '" + canaryExecutionId + "'"));
Map<String, Object> contextContext = contextStage.getContext();

Stage mixerStage = pipeline.getStages().stream()
.filter(stage -> stage.getRefId().equals(REFID_MIX_METRICS))
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + REFID_JUDGE + "' in pipeline ID '" + canaryExecutionId + "'"));
Map<String, Object> mixerContext = mixerStage.getContext();

if (!contextContext.containsKey("canaryConfigId")) {
throw new IllegalArgumentException("The judge stage does not contain a canaryConfigId reference");
}
Expand All @@ -289,6 +295,7 @@ public CanaryExecutionStatusResponse getCanaryResults(@RequestParam(required = f
canaryExecutionStatusResponseBuilder.stageStatus(stageStatus);
canaryExecutionStatusResponseBuilder.complete(isComplete);
canaryExecutionStatusResponseBuilder.status(pipelineStatus);
canaryExecutionStatusResponseBuilder.metricSetPairListId((String)mixerContext.get("metricSetPairListId"));

if (isComplete && pipelineStatus.equals("succeeded")) {
if (judgeContext.containsKey("canaryJudgeResultId")) {
Expand Down

0 comments on commit 1edc513

Please sign in to comment.