Skip to content

Commit

Permalink
Excavator: Upgrades Baseline to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-excavator-bot committed Jun 22, 2021
1 parent 33443f6 commit 9c3085a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@
<property name="ignoredAnnotations" value="ParameterizedTest, Test, Before, BeforeEach, After, AfterEach, BeforeClass, BeforeAll, AfterClass, AfterAll"/>
</module>
<module name="JavadocMethod"> <!-- Java Style Guide: Where Javadoc is used -->
<property name="scope" value="public"/>
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowedAnnotations" value="Override, Test"/>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ buildscript {
classpath 'com.palantir.gradle.externalpublish:gradle-external-publish-plugin:1.2.1'
classpath 'com.palantir.gradle.revapi:gradle-revapi:1.4.4'
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.0.1'
classpath 'com.palantir.baseline:gradle-baseline-java:3.83.0'
classpath 'com.palantir.baseline:gradle-baseline-java:3.93.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.3'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.3.0'
classpath 'com.palantir.metricschema:gradle-metric-schema:0.6.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void record(
assertThat(hostname).isEqualTo("foo");
assertThat(port).isEqualTo(1001);
assertThat(statusCode).isEqualTo(200);
assertThat(micros).isEqualTo(TimeUnit.MICROSECONDS.convert(3, TimeUnit.SECONDS));
assertThat(micros).isEqualTo(TimeUnit.MICROSECONDS.convert(Duration.ofSeconds(3)));
recorded.set(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.codahale.metrics.Clock;
import com.github.benmanes.caffeine.cache.Ticker;
import java.time.Duration;
import java.util.concurrent.TimeUnit;

final class CodahaleClock extends Clock {
Expand All @@ -34,6 +35,6 @@ public long getTick() {

@Override
public long getTime() {
return TimeUnit.MILLISECONDS.convert(getTick(), TimeUnit.NANOSECONDS);
return TimeUnit.MILLISECONDS.convert(Duration.ofNanos(getTick()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.palantir.dialogue.core;

import java.time.Duration;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.Callable;
Expand Down Expand Up @@ -274,7 +275,7 @@ public boolean repeats() {

@Override
public long getDelay(TimeUnit unit) {
return unit.convert(deltaQueue.delay(this), TimeUnit.NANOSECONDS);
return unit.convert(Duration.ofNanos(deltaQueue.delay(this)));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.palantir.logsafe.SafeArg;
import com.palantir.tritium.metrics.registry.MetricName;
import java.io.IOException;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
Expand Down Expand Up @@ -93,7 +94,7 @@ public void report() {
});

long nanos = simulation.clock().read();
double seconds = TimeUnit.MILLISECONDS.convert(nanos, TimeUnit.NANOSECONDS) / 1000d;
double seconds = TimeUnit.MILLISECONDS.convert(Duration.ofNanos(nanos)) / 1000d;
measurements.get(X_AXIS).add(seconds);
}

Expand Down Expand Up @@ -140,7 +141,7 @@ public XYChart chart(Pattern metricNameRegex) {

if (!simulation.events().getEvents().isEmpty()) {
double[] eventXs = simulation.events().getEvents().keySet().stream()
.mapToDouble(nanos -> TimeUnit.MILLISECONDS.convert(nanos, TimeUnit.NANOSECONDS) / 1000d)
.mapToDouble(nanos -> TimeUnit.MILLISECONDS.convert(Duration.ofNanos(nanos)) / 1000d)
.toArray();
double[] eventYs = new double[eventXs.length];
String[] strings = simulation.events().getEvents().values().stream().toArray(String[]::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ public void after(TestInfo testInfo) throws IOException {
Duration serverCpu = Duration.ofNanos(
MetricNames.globalServerTimeNanos(simulation.taggedMetrics()).getCount());
long clientMeanNanos = (long) result.clientHistogram().getMean();
double clientMeanMillis = TimeUnit.MILLISECONDS.convert(clientMeanNanos, TimeUnit.NANOSECONDS);
double clientMeanMillis = TimeUnit.MILLISECONDS.convert(Duration.ofNanos(clientMeanNanos));

// intentionally using tabs so that opening report.txt with 'cat' aligns columns nicely
String longSummary = String.format(
Expand Down

0 comments on commit 9c3085a

Please sign in to comment.