use of org.openjdk.jmh.annotations.Threads in project atlasdb by palantir.
the class StreamStoreBenchmarks method loadSmallStream.
@Benchmark
@Threads(1)
@Warmup(time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(time = 5, timeUnit = TimeUnit.SECONDS)
public void loadSmallStream(StreamingTable table) throws IOException {
long id = table.getSmallStreamId();
TransactionManager transactionManager = table.getTransactionManager();
StreamTestTableFactory tables = StreamTestTableFactory.of();
ValueStreamStore store = ValueStreamStore.of(transactionManager, tables);
try (InputStream inputStream = transactionManager.runTaskThrowOnConflict(txn -> store.loadStream(txn, id));
InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
BufferedReader bufferedReader = new BufferedReader(reader)) {
String line = bufferedReader.readLine();
assertThat(line, startsWith("bytes"));
}
}
use of org.openjdk.jmh.annotations.Threads in project atlasdb by palantir.
the class StreamStoreBenchmarks method loadVeryLargeStream.
@Benchmark
@Threads(1)
@Warmup(time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(time = 30, timeUnit = TimeUnit.SECONDS)
public void loadVeryLargeStream(StreamingTable table) throws IOException {
long id = table.getVeryLargeStreamId();
TransactionManager transactionManager = table.getTransactionManager();
StreamTestTableFactory tables = StreamTestTableFactory.of();
ValueStreamStore store = ValueStreamStore.of(transactionManager, tables);
try (InputStream inputStream = transactionManager.runTaskThrowOnConflict(txn -> store.loadStream(txn, id))) {
byte[] firstBytes = new byte[16];
int read = inputStream.read(firstBytes);
assertThat(read, is(16));
assertArrayEquals(table.getVeryLargeStreamFirstBytes(), firstBytes);
}
}
Aggregations