20
20
import net .openhft .affinity .AffinityLock ;
21
21
import net .openhft .chronicle .bytes .Bytes ;
22
22
import net .openhft .chronicle .bytes .MethodReader ;
23
+ import net .openhft .chronicle .core .Jvm ;
23
24
import net .openhft .chronicle .core .io .IORuntimeException ;
24
25
import net .openhft .chronicle .core .io .IOTools ;
25
26
import net .openhft .chronicle .core .util .NanoSampler ;
@@ -76,7 +77,6 @@ public static void main(String[] args) {
76
77
int throughput = Integer .getInteger ("benchmarkThroughput" , 20_000 );
77
78
System .out .println ("Throughput: " + throughput );
78
79
79
- // disable as otherwise single GC event skews results heavily
80
80
JLBHOptions lth = new JLBHOptions ()
81
81
.warmUpIterations (100_000 )
82
82
.iterations (iterations )
@@ -96,14 +96,14 @@ public void init(JLBH jlbh) {
96
96
if (benchmarkQueuePath != null ) {
97
97
System .out .println ("Creating queue in dir: " + benchmarkQueuePath );
98
98
99
- IOTools .deleteDirWithFiles (benchmarkQueuePath , 10 );
99
+ IOTools .deleteDirWithFilesOrThrow (benchmarkQueuePath );
100
100
101
101
queue = ChronicleQueue .single (benchmarkQueuePath );
102
102
} else {
103
103
System .out .println ("Creating queue in temp dir" );
104
104
105
105
try {
106
- queue = ChronicleQueue .single (Files .createTempDirectory ("temp" ).toString ());
106
+ queue = ChronicleQueue .single (Files .createTempDirectory (this . getClass (). getSimpleName () ).toString ());
107
107
} catch (IOException e ) {
108
108
throw new IORuntimeException (e );
109
109
}
@@ -148,10 +148,11 @@ public void init(JLBH jlbh) {
148
148
jlbh .sample (System .nanoTime () - startNs );
149
149
}
150
150
}
151
+ } catch (Throwable e ) {
152
+ Jvm .error ().on (MethodReaderBenchmark .class , "Reading thread failed" , e );
151
153
}
152
154
});
153
155
consumerThread .start ();
154
-
155
156
}
156
157
157
158
@ Override
0 commit comments