X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fbenchmark-data-store%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fbenchmark%2FInMemoryDataStoreWriteTransactionBenchmark.java;h=c614085fee8b15b52d881e8b87316374dbf51048;hb=refs%2Fchanges%2F63%2F82963%2F3;hp=d3dda96af5aa309d329b7800a94f831e7d3a898b;hpb=4019c9fd2ad99628dd790acc1ad4c104f48b6428;p=controller.git diff --git a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWriteTransactionBenchmark.java b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWriteTransactionBenchmark.java index d3dda96af5..c614085fee 100644 --- a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWriteTransactionBenchmark.java +++ b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWriteTransactionBenchmark.java @@ -7,25 +7,26 @@ */ package org.opendaylight.controller.md.sal.dom.store.benchmark; -import com.google.common.util.concurrent.MoreExecutors; +import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.State; +import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore; import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; -import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.TearDown; /** - * Benchmark for testing of performance of write operations for InMemoryDataStore. The instance - * of benchmark creates InMemoryDataStore with Data Change Listener Executor Service as Same Thread Executor - * and DOM Store Executor Service as Same Thread Executor. + * Benchmark for testing of performance of write operations for + * InMemoryDataStore. The instance of benchmark creates InMemoryDataStore with + * Data Change Listener Executor Service as Same Thread Executor and DOM Store + * Executor Service as Same Thread Executor. * - * @author Lukas Sedlak + * @author Lukas Sedlak */ @State(Scope.Thread) @BenchmarkMode(Mode.AverageTime) @@ -33,15 +34,16 @@ import org.openjdk.jmh.annotations.TearDown; @Fork(1) public class InMemoryDataStoreWriteTransactionBenchmark extends AbstractInMemoryDatastoreWriteTransactionBenchmark { + @Override @Setup(Level.Trial) public void setUp() throws Exception { - domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", MoreExecutors.sameThreadExecutor(), - MoreExecutors.sameThreadExecutor()); + domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", Executors.newSingleThreadExecutor()); schemaContext = BenchmarkModel.createTestContext(); domStore.onGlobalContextUpdated(schemaContext); initTestNode(); } + @Override @TearDown public void tearDown() { schemaContext = null;