Search in sources :

Example 16 with Threads

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"));
    }
}
Also used : InputStreamReader(java.io.InputStreamReader) TransactionManager(com.palantir.atlasdb.transaction.api.TransactionManager) InputStream(java.io.InputStream) BufferedReader(java.io.BufferedReader) StreamTestTableFactory(com.palantir.atlasdb.performance.schema.generated.StreamTestTableFactory) ValueStreamStore(com.palantir.atlasdb.performance.schema.generated.ValueStreamStore) Threads(org.openjdk.jmh.annotations.Threads) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Example 17 with Threads

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);
    }
}
Also used : TransactionManager(com.palantir.atlasdb.transaction.api.TransactionManager) InputStream(java.io.InputStream) StreamTestTableFactory(com.palantir.atlasdb.performance.schema.generated.StreamTestTableFactory) ValueStreamStore(com.palantir.atlasdb.performance.schema.generated.ValueStreamStore) Threads(org.openjdk.jmh.annotations.Threads) Measurement(org.openjdk.jmh.annotations.Measurement) Warmup(org.openjdk.jmh.annotations.Warmup) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

Threads (org.openjdk.jmh.annotations.Threads)17 Benchmark (org.openjdk.jmh.annotations.Benchmark)15 Measurement (org.openjdk.jmh.annotations.Measurement)8 Warmup (org.openjdk.jmh.annotations.Warmup)8 DirectBuffer (org.agrona.DirectBuffer)5 Transaction (co.elastic.apm.impl.transaction.Transaction)4 ColumnRangeSelection (com.palantir.atlasdb.keyvalue.api.ColumnRangeSelection)4 TaskEvent (io.zeebe.broker.taskqueue.data.TaskEvent)4 MutableDirectBuffer (org.agrona.MutableDirectBuffer)4 RowColumnRangeIterator (com.palantir.atlasdb.keyvalue.api.RowColumnRangeIterator)3 StreamTestTableFactory (com.palantir.atlasdb.performance.schema.generated.StreamTestTableFactory)3 ValueStreamStore (com.palantir.atlasdb.performance.schema.generated.ValueStreamStore)3 TransactionManager (com.palantir.atlasdb.transaction.api.TransactionManager)3 InputStream (java.io.InputStream)3 ArrayList (java.util.ArrayList)2 ByteBuf (io.netty.buffer.ByteBuf)1 CompositeByteBuf (io.netty.buffer.CompositeByteBuf)1 BufferedReader (java.io.BufferedReader)1 InputStreamReader (java.io.InputStreamReader)1 BenchmarkMode (org.openjdk.jmh.annotations.BenchmarkMode)1