Skip to content

Commit d5f2d2e

Browse files
committed
log error if thread fails in MethodReaderBenchmark
1 parent 7475af6 commit d5f2d2e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/test/java/net/openhft/chronicle/queue/bench/MethodReaderBenchmark.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import net.openhft.affinity.AffinityLock;
2121
import net.openhft.chronicle.bytes.Bytes;
2222
import net.openhft.chronicle.bytes.MethodReader;
23+
import net.openhft.chronicle.core.Jvm;
2324
import net.openhft.chronicle.core.io.IORuntimeException;
2425
import net.openhft.chronicle.core.io.IOTools;
2526
import net.openhft.chronicle.core.util.NanoSampler;
@@ -76,7 +77,6 @@ public static void main(String[] args) {
7677
int throughput = Integer.getInteger("benchmarkThroughput", 20_000);
7778
System.out.println("Throughput: " + throughput);
7879

79-
// disable as otherwise single GC event skews results heavily
8080
JLBHOptions lth = new JLBHOptions()
8181
.warmUpIterations(100_000)
8282
.iterations(iterations)
@@ -96,14 +96,14 @@ public void init(JLBH jlbh) {
9696
if (benchmarkQueuePath != null) {
9797
System.out.println("Creating queue in dir: " + benchmarkQueuePath);
9898

99-
IOTools.deleteDirWithFiles(benchmarkQueuePath, 10);
99+
IOTools.deleteDirWithFilesOrThrow(benchmarkQueuePath);
100100

101101
queue = ChronicleQueue.single(benchmarkQueuePath);
102102
} else {
103103
System.out.println("Creating queue in temp dir");
104104

105105
try {
106-
queue = ChronicleQueue.single(Files.createTempDirectory("temp").toString());
106+
queue = ChronicleQueue.single(Files.createTempDirectory(this.getClass().getSimpleName()).toString());
107107
} catch (IOException e) {
108108
throw new IORuntimeException(e);
109109
}
@@ -148,10 +148,11 @@ public void init(JLBH jlbh) {
148148
jlbh.sample(System.nanoTime() - startNs);
149149
}
150150
}
151+
} catch (Throwable e) {
152+
Jvm.error().on(MethodReaderBenchmark.class, "Reading thread failed", e);
151153
}
152154
});
153155
consumerThread.start();
154-
155156
}
156157

157158
@Override

0 commit comments

Comments
 (0)