Skip to content

Commit

Permalink
atlas supports asg, cluster, and query scopes, not application scope (#…
Browse files Browse the repository at this point in the history
…100)

* atlas supports asg, cluster, and query scopes, not application scope

* update tests
  • Loading branch information
Michael Graff committed Oct 11, 2017
1 parent 61d0f34 commit fe91806
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public class AtlasCanaryScope extends CanaryScope {

public String cq() {
if (type == null) {
throw new IllegalArgumentException("Atlas canary scope requires 'type' to be application, cluster or query.");
throw new IllegalArgumentException("Atlas canary scope requires 'type' to be asg, cluster, or query.");
}

switch (type) {
case "application":
return ":list,(,nf.app," + scope + ",:eq,:cq,),:each";
case "asg":
return ":list,(,nf.asg," + scope + ",:eq,:cq,),:each";
case "cluster":
return ":list,(,nf.cluster," + scope + ",:eq,:cq,),:each";
case "query":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ public void loadConfig() throws Exception {

// 2. Define scope for baseline and canary clusters
AtlasCanaryScope experiment = new AtlasCanaryScope();
experiment.setType("application");
experiment.setScope("app_leo");
experiment.setType("asg");
experiment.setScope("kayenta-iep-v400");
experiment.setStart("0");
experiment.setEnd("600000");
experiment.setStep("PT1M");
AtlasCanaryScope control = new AtlasCanaryScope();
control.setType("application");
control.setScope("app_lep");
control.setType("asg");
control.setScope("kayenta-iep-v401");
control.setStart("0");
control.setEnd("600000");
control.setStep("PT1M");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public String initiateCanary(@RequestParam(required = false) final String metric
@ApiParam(defaultValue = "2017-07-02T15:27:00Z") @RequestParam String endTimeIso,
// TODO(duftler): Normalize this somehow. Stackdriver expects a number in seconds and Atlas expects a duration like PT10S.
@ApiParam(value = "Stackdriver expects a number in seconds and Atlas expects a duration like PT10S.", defaultValue = "3600") @RequestParam String step,
@ApiParam(value = "Atlas requires \"type\" to be set to application, cluster or query.") @RequestBody(required = false) Map<String, String> extendedScopeParams,
@ApiParam(value = "Atlas requires \"type\" to be set to asg, cluster, or query.") @RequestBody(required = false) Map<String, String> extendedScopeParams,
@RequestParam(required = false) String scoreThresholdPass,
@RequestParam(required = false) String scoreThresholdMarginal) {
String resolvedMetricsAccountName = CredentialsHelper.resolveAccountByNameOrType(metricsAccountName,
Expand Down

0 comments on commit fe91806

Please sign in to comment.