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 java.util.concurrent.Executors;
11 import java.util.concurrent.TimeUnit;
12 import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
13 import org.openjdk.jmh.annotations.BenchmarkMode;
14 import org.openjdk.jmh.annotations.Fork;
15 import org.openjdk.jmh.annotations.Level;
16 import org.openjdk.jmh.annotations.Mode;
17 import org.openjdk.jmh.annotations.OutputTimeUnit;
18 import org.openjdk.jmh.annotations.Scope;
19 import org.openjdk.jmh.annotations.Setup;
20 import org.openjdk.jmh.annotations.State;
21 import org.openjdk.jmh.annotations.TearDown;
24 * Benchmark for testing of performance of write operations for
25 * InMemoryDataStore. The instance of benchmark creates InMemoryDataStore with
26 * Data Change Listener Executor Service as Same Thread Executor and DOM Store
27 * Executor Service as Same Thread Executor.
29 * @author Lukas Sedlak
32 @BenchmarkMode(Mode.AverageTime)
33 @OutputTimeUnit(TimeUnit.MILLISECONDS)
35 public class InMemoryDataStoreWriteTransactionBenchmark extends AbstractInMemoryDatastoreWriteTransactionBenchmark {
39 public void setUp() throws Exception {
40 domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", Executors.newSingleThreadExecutor());
41 schemaContext = BenchmarkModel.createTestContext();
42 domStore.onGlobalContextUpdated(schemaContext);
48 public void tearDown() {