Skip to content

Commit

Permalink
feat(pipeline): Add durationString to canned canary pipeline output. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Duftler committed Aug 30, 2017
1 parent 5d8b13a commit 50598b8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.Duration;
import java.time.Instant;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -185,6 +186,7 @@ public String initiateCanary(@RequestParam(required = false) final String metric
orchestratorScoreThresholds = canaryConfig.getClassifier().getScoreThresholds();
}

Duration duration = Duration.between(startTimeInstant, endTimeInstant);
Map<String, Object> canaryJudgeContext =
Maps.newHashMap(
new ImmutableMap.Builder<String, Object>()
Expand All @@ -194,6 +196,7 @@ public String initiateCanary(@RequestParam(required = false) final String metric
.put("storageAccountName", resolvedStorageAccountName)
.put("canaryConfigId", canaryConfigId)
.put("metricSetPairListId", "${ #stage('Mix Control and Experiment Results')['context']['metricSetPairListId']}")
.put("durationString", duration.toString())
.put("orchestratorScoreThresholds", orchestratorScoreThresholds)
.build());

Expand Down

0 comments on commit 50598b8

Please sign in to comment.