Skip to content

Commit

Permalink
start on judge response (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Graff committed Jun 22, 2017
1 parent 996876f commit f1f25d8
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.netflix.kayenta.canary;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

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

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

// Todo: (mgraff) How to describe pre- and post-filter results?
// Todo: (mgraff) Add a place to return additional timeseries data
// Todo: (mgraff) Add a way to describe graph annotations on canary, baseline, and additional TS

@NotNull
@Getter
private String name;

@NotNull
@Getter
private Map<String, String> tags;

@NotNull
@Getter
private CanaryJudgeScore score;

@NotNull
@Getter
private List<String> groups;

@NotNull
@Getter
private Map<String, String> experimentMetrics;

@NotNull
@Getter
private Map<String, String> controlMetrics;

@NotNull
@Getter
private Map<String, String> resultMetrics;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright 2017 Netflix, 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.*;

import javax.validation.constraints.NotNull;

@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CanaryJudgeGroupScore {
@NotNull
@Getter
private String name;

@NotNull
@Getter
private CanaryJudgeScore score;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright 2017 Netflix, 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.List;
import java.util.Map;

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

@NotNull
@Getter
private Map<String, CanaryAnalysisResult> results;

@NotNull
@Getter
private List<CanaryJudgeGroupScore> groupScores;

@NotNull
@Getter
private CanaryJudgeSummary summary;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2017 Netflix, 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.*;

import javax.validation.constraints.NotNull;

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

@NotNull
@Getter
private double score;

@NotNull
@Getter
private String classification;

@NotNull
@Getter
private String classificationReason;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2017 Netflix, 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.*;

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

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

@NotNull
@Getter
private CanaryJudgeScore score;

// Todo: (mgraff) This is only used for freemarker email reports, remove?
@NotNull
@Getter
private List<CanaryJudgeSummaryClassification> classificationCounts;

// Todo: (mgraff) This is only used for freemarker email reports, remove?
@Getter
private int metricCount;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.netflix.kayenta.canary;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;

import javax.validation.constraints.NotNull;

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

@NotNull
@Getter
private String name;

@Getter
private int count;
}

0 comments on commit f1f25d8

Please sign in to comment.