Skip to content

Commit

Permalink
Apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rh-appservices-perf authored and johnaohara committed Sep 2, 2024
1 parent 285ec51 commit e59bd5c
Show file tree
Hide file tree
Showing 288 changed files with 22,916 additions and 22,309 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.hyperfoil.tools.horreum.api;

public enum SortDirection {
Ascending,
Descending
Ascending,
Descending
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package io.hyperfoil.tools.horreum.api;

import io.quarkus.logging.Log;

import java.io.IOException;
import java.util.Properties;

import io.quarkus.logging.Log;

public class Version {
public static final String getVersion(){
final Properties properties = new Properties();
try {
properties.load(Version.class.getClassLoader().getResourceAsStream("build.properties"));
return properties.getProperty("horreum.version");
} catch (IOException e) {
Log.error("Failed to load version.properties",e);
}
return null;
}
public static final String getVersion() {
final Properties properties = new Properties();
try {
properties.load(Version.class.getClassLoader().getResourceAsStream("build.properties"));
return properties.getProperty("horreum.version");
} catch (IOException e) {
Log.error("Failed to load version.properties", e);
}
return null;
}
}
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
package io.hyperfoil.tools.horreum.api.alerting;

import java.time.Instant;

import jakarta.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.hyperfoil.tools.horreum.api.data.Dataset;

import jakarta.validation.constraints.NotNull;
import java.time.Instant;
import io.hyperfoil.tools.horreum.api.data.Dataset;

public class Change {
@JsonProperty( required = true )
@JsonProperty(required = true)
public int id;
@NotNull
@JsonProperty( required = true )
@JsonProperty(required = true)
public Variable variable;
@JsonIgnore
public Dataset dataset;
@NotNull
@JsonProperty( required = true )
@JsonProperty(required = true)
public Instant timestamp;
@NotNull
@JsonProperty( required = true )
@JsonProperty(required = true)
public boolean confirmed;
public String description;

Expand All @@ -32,7 +34,9 @@ public Dataset.Info getDatasetId() {
}

public String toString() {
return "Change{id=" + this.id + ", variable=" + this.variable.id + ", dataset=" + this.dataset.id + " (" + this.dataset.runId + "/" + this.dataset.ordinal + "), timestamp=" + this.timestamp + ", confirmed=" + this.confirmed + ", description='" + this.description + '\'' + '}';
return "Change{id=" + this.id + ", variable=" + this.variable.id + ", dataset=" + this.dataset.id + " ("
+ this.dataset.runId + "/" + this.dataset.ordinal + "), timestamp=" + this.timestamp + ", confirmed="
+ this.confirmed + ", description='" + this.description + '\'' + '}';
}

public static class Event {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
package io.hyperfoil.tools.horreum.api.alerting;

import jakarta.validation.constraints.NotNull;

import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.DiscriminatorMapping;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.node.ObjectNode;

import io.hyperfoil.tools.horreum.api.data.changeDetection.ChangeDetectionModelType;
import io.hyperfoil.tools.horreum.api.data.changeDetection.EDivisiveDetectionConfig;
import io.hyperfoil.tools.horreum.api.data.changeDetection.FixedThresholdDetectionConfig;
import io.hyperfoil.tools.horreum.api.data.changeDetection.RelativeDifferenceDetectionConfig;
import jakarta.validation.constraints.NotNull;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.DiscriminatorMapping;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

public class ChangeDetection {


@JsonProperty( required = true )
@JsonProperty(required = true)
public Integer id;
@JsonProperty( required = true )
@JsonProperty(required = true)
public String model;
@NotNull
@JsonProperty( required = true )
@Schema(type = SchemaType.OBJECT, discriminatorProperty = "model",
discriminatorMapping = {
@DiscriminatorMapping(schema = RelativeDifferenceDetectionConfig.class, value = ChangeDetectionModelType.names.RELATIVE_DIFFERENCE),
@DiscriminatorMapping(schema = FixedThresholdDetectionConfig.class, value = ChangeDetectionModelType.names.FIXED_THRESHOLD),
@DiscriminatorMapping(schema = EDivisiveDetectionConfig.class, value = ChangeDetectionModelType.names.EDIVISIVE)
},
oneOf = {
RelativeDifferenceDetectionConfig.class,
FixedThresholdDetectionConfig.class,
EDivisiveDetectionConfig.class
}
)
@JsonProperty(required = true)
@Schema(type = SchemaType.OBJECT, discriminatorProperty = "model", discriminatorMapping = {
@DiscriminatorMapping(schema = RelativeDifferenceDetectionConfig.class, value = ChangeDetectionModelType.names.RELATIVE_DIFFERENCE),
@DiscriminatorMapping(schema = FixedThresholdDetectionConfig.class, value = ChangeDetectionModelType.names.FIXED_THRESHOLD),
@DiscriminatorMapping(schema = EDivisiveDetectionConfig.class, value = ChangeDetectionModelType.names.EDIVISIVE)
}, oneOf = {
RelativeDifferenceDetectionConfig.class,
FixedThresholdDetectionConfig.class,
EDivisiveDetectionConfig.class
})
public ObjectNode config;

public ChangeDetection() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package io.hyperfoil.tools.horreum.api.alerting;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.hyperfoil.tools.horreum.api.data.Dataset;
import java.time.Instant;

import jakarta.validation.constraints.NotNull;

import java.time.Instant;
import com.fasterxml.jackson.annotation.JsonProperty;

import io.hyperfoil.tools.horreum.api.data.Dataset;

public class DataPoint {
public Integer id;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
package io.hyperfoil.tools.horreum.api.alerting;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.hyperfoil.tools.horreum.api.data.PersistentLog;
import jakarta.validation.constraints.NotNull;

import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

@Schema( type = SchemaType.OBJECT, description = "Dataset Log", name = "DatasetLog", allOf = PersistentLog.class)
import com.fasterxml.jackson.annotation.JsonProperty;

import io.hyperfoil.tools.horreum.api.data.PersistentLog;

@Schema(type = SchemaType.OBJECT, description = "Dataset Log", name = "DatasetLog", allOf = PersistentLog.class)
public class DatasetLog extends PersistentLog {
@NotNull
@JsonProperty( required = true )
@JsonProperty(required = true)
public String source;

@JsonProperty( value = "testId", required = true )
@JsonProperty(value = "testId", required = true)
private Integer testId;

@JsonProperty( value = "runId", required = true )
@JsonProperty(value = "runId", required = true)
private Integer runId;

@JsonProperty( value = "datasetId", required = true )
@JsonProperty(value = "datasetId", required = true)
private Integer datasetId;

@JsonProperty( value = "datasetOrdinal", required = true )
@JsonProperty(value = "datasetOrdinal", required = true)
private Integer datasetOrdinal;

public DatasetLog() {
super(0, (String)null);
super(0, (String) null);
}

public DatasetLog(Integer testId, Integer datasetId, Integer datasetOrdinal, Integer runId,
int level, String source, String message) {
int level, String source, String message) {
super(level, message);
this.testId = testId;
this.datasetId = datasetId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
package io.hyperfoil.tools.horreum.api.alerting;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.node.ArrayNode;
import java.time.Instant;
import java.util.Objects;

import jakarta.validation.constraints.NotNull;

import org.eclipse.microprofile.openapi.annotations.media.Schema;

import java.time.Instant;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.node.ArrayNode;

public class MissingDataRule {
@JsonProperty( required = true )
@JsonProperty(required = true)
public Integer id;
public String name;
@Schema(implementation = String[].class)
public ArrayNode labels;
public String condition;
@NotNull
@JsonProperty( required = true )
@JsonProperty(required = true)
public long maxStaleness;
public Instant lastNotification;

@JsonProperty( value = "testId", required = true )
@JsonProperty(value = "testId", required = true)
public Integer testId;

public MissingDataRule() {
Expand All @@ -30,14 +32,15 @@ public boolean equals(Object o) {
if (this == o) {
return true;
} else if (o != null && this.getClass() == o.getClass()) {
MissingDataRule that = (MissingDataRule)o;
return this.maxStaleness == that.maxStaleness && Objects.equals(this.labels, that.labels) && Objects.equals(this.condition, that.condition);
MissingDataRule that = (MissingDataRule) o;
return this.maxStaleness == that.maxStaleness && Objects.equals(this.labels, that.labels)
&& Objects.equals(this.condition, that.condition);
} else {
return false;
}
}

public int hashCode() {
return Objects.hash(new Object[]{this.labels, this.condition, this.maxStaleness});
return Objects.hash(new Object[] { this.labels, this.condition, this.maxStaleness });
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.hyperfoil.tools.horreum.api.alerting;

import jakarta.validation.constraints.NotNull;

import java.time.Instant;
import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;

import jakarta.validation.constraints.NotNull;

public class MissingDataRuleResult {
private Pk pk;
@NotNull
Expand All @@ -31,7 +31,8 @@ public int datasetId() {
}

public String toString() {
return "MissingDataRuleResult{dataset_id=" + this.pk.datasetId + ", rule_id=" + this.pk.ruleId + ", timestamp=" + this.timestamp + '}';
return "MissingDataRuleResult{dataset_id=" + this.pk.datasetId + ", rule_id=" + this.pk.ruleId + ", timestamp="
+ this.timestamp + '}';
}

public static class Pk implements Serializable {
Expand All @@ -45,15 +46,15 @@ public boolean equals(Object o) {
if (this == o) {
return true;
} else if (o != null && this.getClass() == o.getClass()) {
Pk pk = (Pk)o;
Pk pk = (Pk) o;
return this.ruleId == pk.ruleId && this.datasetId == pk.datasetId;
} else {
return false;
}
}

public int hashCode() {
return Objects.hash(new Object[]{this.ruleId, this.datasetId});
return Objects.hash(new Object[] { this.ruleId, this.datasetId });
}
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
package io.hyperfoil.tools.horreum.api.alerting;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonProperty;

public class NotificationSettings {
public Integer id;
@NotNull
@JsonProperty( required = true )
@JsonProperty(required = true)
public String name;
@JsonProperty( required = true )
@JsonProperty(required = true)
public boolean isTeam;
@NotNull
@JsonProperty( required = true )
@JsonProperty(required = true)
public String method;
public String data;
@NotNull
@JsonProperty( required = true )
@JsonProperty(required = true)
public boolean disabled;

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.hyperfoil.tools.horreum.api.alerting;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.Instant;

import jakarta.validation.constraints.NotNull;

import java.time.Instant;
import com.fasterxml.jackson.annotation.JsonProperty;

public class RunExpectation {
public Long id;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package io.hyperfoil.tools.horreum.api.alerting;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.hyperfoil.tools.horreum.api.data.PersistentLog;
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
import org.eclipse.microprofile.openapi.annotations.media.Schema;

@Schema( type = SchemaType.OBJECT, description = "Transformation Log", name = "TransformationLog")
import com.fasterxml.jackson.annotation.JsonProperty;

import io.hyperfoil.tools.horreum.api.data.PersistentLog;

@Schema(type = SchemaType.OBJECT, description = "Transformation Log", name = "TransformationLog")
public class TransformationLog extends PersistentLog {
@JsonProperty("testId")
private Integer testId;
Expand All @@ -14,7 +16,7 @@ public class TransformationLog extends PersistentLog {
private Integer runId;

public TransformationLog() {
super(0, (String)null);
super(0, (String) null);
}

public TransformationLog(Integer testId, Integer runId, int level, String message) {
Expand Down
Loading

0 comments on commit e59bd5c

Please sign in to comment.