2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.md.sal.dom.store.benchmark;
10 import com.google.common.util.concurrent.MoreExecutors;
11 import java.util.concurrent.TimeUnit;
12 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
13 import org.openjdk.jmh.annotations.Fork;
14 import org.openjdk.jmh.annotations.Scope;
15 import org.openjdk.jmh.annotations.State;
16 import org.openjdk.jmh.annotations.BenchmarkMode;
17 import org.openjdk.jmh.annotations.Mode;
18 import org.openjdk.jmh.annotations.OutputTimeUnit;
19 import org.openjdk.jmh.annotations.Setup;
20 import org.openjdk.jmh.annotations.Level;
21 import org.openjdk.jmh.annotations.TearDown;
24 * Benchmark for testing of performance of write operations for InMemoryDataStore. The instance
25 * of benchmark creates InMemoryDataStore with Data Change Listener Executor Service as Same Thread Executor
26 * and DOM Store Executor Service as Same Thread Executor.
28 * @author Lukas Sedlak <lsedlak@cisco.com>
31 @BenchmarkMode(Mode.AverageTime)
32 @OutputTimeUnit(TimeUnit.MILLISECONDS)
34 public class InMemoryDataStoreWriteTransactionBenchmark extends AbstractInMemoryDatastoreWriteTransactionBenchmark {
37 public void setUp() throws Exception {
38 domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", MoreExecutors.sameThreadExecutor(),
39 MoreExecutors.sameThreadExecutor());
40 schemaContext = BenchmarkModel.createTestContext();
41 domStore.onGlobalContextUpdated(schemaContext);
46 public void tearDown() {