Skip to content

Commit

Permalink
log error if thread fails in MethodReaderBenchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
JerryShea committed Dec 18, 2024
1 parent 7475af6 commit d5f2d2e
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.openhft.affinity.AffinityLock;
import net.openhft.chronicle.bytes.Bytes;
import net.openhft.chronicle.bytes.MethodReader;
import net.openhft.chronicle.core.Jvm;
import net.openhft.chronicle.core.io.IORuntimeException;
import net.openhft.chronicle.core.io.IOTools;
import net.openhft.chronicle.core.util.NanoSampler;
Expand Down Expand Up @@ -76,7 +77,6 @@ public static void main(String[] args) {
int throughput = Integer.getInteger("benchmarkThroughput", 20_000);
System.out.println("Throughput: " + throughput);

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

IOTools.deleteDirWithFiles(benchmarkQueuePath, 10);
IOTools.deleteDirWithFilesOrThrow(benchmarkQueuePath);

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

try {
queue = ChronicleQueue.single(Files.createTempDirectory("temp").toString());
queue = ChronicleQueue.single(Files.createTempDirectory(this.getClass().getSimpleName()).toString());
} catch (IOException e) {
throw new IORuntimeException(e);
}
Expand Down Expand Up @@ -148,10 +148,11 @@ public void init(JLBH jlbh) {
jlbh.sample(System.nanoTime() - startNs);
}
}
} catch (Throwable e) {
Jvm.error().on(MethodReaderBenchmark.class, "Reading thread failed", e);
}
});
consumerThread.start();

}

@Override
Expand Down

0 comments on commit d5f2d2e

Please sign in to comment.