Skip to content

Commit

Permalink
Define canary config classifiers model. (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Duftler committed May 23, 2017
1 parent 0bfdeac commit 3a6cbcd
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright 2017 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.netflix.kayenta.canary;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Singular;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.util.Map;

@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CanaryClassifierConfig {

@NotNull
@Singular
@Getter
private Map<String, Double> groupWeights;

@NotNull
@Getter
private CanaryClassifierThresholdsConfig scoreThresholds;
}

@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
class CanaryClassifierThresholdsConfig {

@NotNull
@Getter
private Double pass;

@NotNull
@Getter
private Double marginal;
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
// TODO(duftler): Define canary config 'classifiers' model class.
public class CanaryConfig {

@NotNull
Expand Down Expand Up @@ -79,4 +78,8 @@ public class CanaryConfig {
@Singular
@Getter
private Map<String, CanaryServiceConfig> services;

@NotNull
@Getter
private CanaryClassifierConfig classifier;
}

0 comments on commit 3a6cbcd

Please sign in to comment.