diff options
author | Ola Aunrønning <olaa@yahoo-inc.com> | 2017-08-08 10:38:13 +0200 |
---|---|---|
committer | Ola Aunrønning <olaa@yahoo-inc.com> | 2017-08-15 12:29:33 +0200 |
commit | 978825570e3a59c274268cbb545caab2b9fbddfc (patch) | |
tree | f8302c7a899e9ef5af18977e7e954256be9e2199 /node-maintainer | |
parent | acddf72245e8b7787edc134b84c9a369d105f080 (diff) |
Code cleanup
Diffstat (limited to 'node-maintainer')
5 files changed, 4 insertions, 19 deletions
diff --git a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/BenchmarkResultInspector.java b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/BenchmarkResultInspector.java index b3ae2264a26..d5174549b9d 100644 --- a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/BenchmarkResultInspector.java +++ b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/BenchmarkResultInspector.java @@ -3,9 +3,6 @@ package com.yahoo.vespa.hosted.node.verification.hardware; import com.yahoo.vespa.hosted.node.verification.hardware.benchmarks.BenchmarkResults; import com.yahoo.vespa.hosted.node.verification.hardware.report.BenchmarkReport; -import java.util.logging.Level; -import java.util.logging.Logger; - public class BenchmarkResultInspector { private static final double CPU_FREQUENCY_LOWER_LIMIT = 0.5; diff --git a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/HardwareBenchmarker.java b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/HardwareBenchmarker.java index 53567fc231a..5bd407ae0fd 100644 --- a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/HardwareBenchmarker.java +++ b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/HardwareBenchmarker.java @@ -9,7 +9,6 @@ import com.yahoo.vespa.hosted.node.verification.hardware.benchmarks.CPUBenchmark import com.yahoo.vespa.hosted.node.verification.hardware.benchmarks.DiskBenchmark; import com.yahoo.vespa.hosted.node.verification.hardware.benchmarks.MemoryBenchmark; import com.yahoo.vespa.hosted.node.verification.hardware.report.BenchmarkReport; -import com.yahoo.vespa.hosted.node.verification.spec.report.VerificationReport; import java.util.ArrayList; import java.util.Arrays; diff --git a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/report/BenchmarkReport.java b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/report/BenchmarkReport.java index 28f2581aa0b..e1b8cd9bb8c 100644 --- a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/report/BenchmarkReport.java +++ b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/hardware/report/BenchmarkReport.java @@ -1,13 +1,7 @@ package com.yahoo.vespa.hosted.node.verification.hardware.report; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.yahoo.vespa.hosted.node.verification.hardware.benchmarks.BenchmarkResults; - -import java.util.HashMap; -import java.util.Map; /** * Created by sgrostad on 12/07/2017. diff --git a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/spec/HardwareNodeComparator.java b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/spec/HardwareNodeComparator.java index 99942611e60..82664424c0a 100644 --- a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/spec/HardwareNodeComparator.java +++ b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/spec/HardwareNodeComparator.java @@ -32,7 +32,7 @@ public class HardwareNodeComparator { private static void setMemoryMetrics(HardwareInfo nodeRepoHardwareInfo, HardwareInfo actualHardware, VerificationReport verificationReport) { double expectedMemory = nodeRepoHardwareInfo.getMinMainMemoryAvailableGb(); double actualMemory = actualHardware.getMinMainMemoryAvailableGb(); - if (!insideThreshold(expectedMemory, actualMemory, PERCENTAGE_THRESHOLD)) { + if (outsideThreshold(expectedMemory, actualMemory, PERCENTAGE_THRESHOLD)) { verificationReport.setActualMemoryAvailable(actualMemory); } } @@ -56,7 +56,7 @@ public class HardwareNodeComparator { private static void setDiskSpaceMetrics(HardwareInfo nodeRepoHardwareInfo, HardwareInfo actualHardware, VerificationReport verificationReport) { double expectedDiskSpace = nodeRepoHardwareInfo.getMinDiskAvailableGb(); double actualDiskSpace = actualHardware.getMinDiskAvailableGb(); - if (!insideThreshold(expectedDiskSpace, actualDiskSpace, PERCENTAGE_THRESHOLD)) { + if (outsideThreshold(expectedDiskSpace, actualDiskSpace, PERCENTAGE_THRESHOLD)) { verificationReport.setActualDiskSpaceAvailable(actualDiskSpace); } } @@ -72,7 +72,7 @@ public class HardwareNodeComparator { verificationReport.setActualIpv6Connection(actualHardware.isIpv6Connection()); } - private static boolean insideThreshold(double value1, double value2 , double thresholdPercentage) { + private static boolean outsideThreshold(double value1, double value2 , double thresholdPercentage) { double lowerThresholdPercentage = 1 - thresholdPercentage; double upperThresholdPercentage = 1 + thresholdPercentage; return value1 < lowerThresholdPercentage * value2 || value1 > upperThresholdPercentage * value2; diff --git a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/spec/VerifierSettings.java b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/spec/VerifierSettings.java index 2ff2e41d9bc..936c19f6c7f 100644 --- a/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/spec/VerifierSettings.java +++ b/node-maintainer/src/main/java/com/yahoo/vespa/hosted/node/verification/spec/VerifierSettings.java @@ -16,12 +16,7 @@ public class VerifierSettings { } public VerifierSettings(NodeRepoJsonModel nodeRepoJsonModel){ - if (nodeRepoJsonModel.getIpv6Address() != null){ - checkIPv6 = true; - } - else { - checkIPv6 = false; - } + checkIPv6 = nodeRepoJsonModel.getIpv6Address() != null; } public boolean isCheckIPv6() { |