Skip to content

Commit

Permalink
feat(core): update swagger docs for CanaryClassifierConfig,CanaryClas…
Browse files Browse the repository at this point in the history
…sifierThresholdsConfig, CanaryJudgeConfig, CanaryAnalysisExecutionRequestScope (#667)
  • Loading branch information
Nastya Smirnova authored Feb 4, 2020
1 parent f1c3b03 commit 441bdca
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package com.netflix.kayenta.canary;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.*;
Expand All @@ -26,9 +28,19 @@
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(description = "The classification configuration, such as group weights.")
public class CanaryClassifierConfig {

@NotNull @Singular @Getter private Map<String, Double> groupWeights;
@ApiModelProperty(
value =
"List of each metrics group along with its corresponding weight. Weights must total 100.",
example = "{\"pod-group\": 70, \"app-group\": 30}")
@NotNull
@Singular
@Getter
private Map<String, Double> groupWeights;

@Getter private CanaryClassifierThresholdsConfig scoreThresholds;
@ApiModelProperty(hidden = true)
@Getter
private CanaryClassifierThresholdsConfig scoreThresholds;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package com.netflix.kayenta.canary;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import lombok.*;

Expand All @@ -25,9 +27,20 @@
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(description = "Sets thresholds for canary score.")
public class CanaryClassifierThresholdsConfig {

@NotNull @Getter private Double pass;
@ApiModelProperty(
value = "If canary score is higher than this value -- canary is considered successful.",
example = "75.0")
@NotNull
@Getter
private Double pass;

@NotNull @Getter private Double marginal;
@ApiModelProperty(
value = "If canary score is lower than this value -- canary is considered marginal (failed).",
example = "50.0")
@NotNull
@Getter
private Double marginal;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package com.netflix.kayenta.canary;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Map;
import javax.validation.constraints.NotNull;
import lombok.*;
Expand All @@ -26,9 +28,24 @@
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(description = "Judge configuration.")
public class CanaryJudgeConfig {

@NotNull @Getter private String name;
@ApiModelProperty(
value = "Judge to use, as of right now there is only `NetflixACAJudge-v1.0`.",
example = "NetflixACAJudge-v1.0",
required = true)
@NotNull
@Getter
private String name;

@NotNull @Singular @Getter private Map<String, Object> judgeConfigurations;
@ApiModelProperty(
value =
"Additional judgement configuration. As of right now, this should always be an empty object.",
example = "{}",
required = true)
@NotNull
@Singular
@Getter
private Map<String, Object> judgeConfigurations;
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
public class CanaryAnalysisExecutionRequestScope {

@Builder.Default
@ApiModelProperty(value = "TODO: needs to be updated", example = "default")
@ApiModelProperty(value = "Specifies unique name of the metrics scope.", example = "default")
String scopeName = "default";

@ApiModelProperty(
Expand Down

0 comments on commit 441bdca

Please sign in to comment.