From 470cf87d0618087e416dafadb815996320e6c427 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 27 Apr 2020 13:22:03 +0200 Subject: [PATCH] Remove benchmark-data-store This code has been migrated to mdsal component, remove it. Change-Id: I238f7e09a3907ce07cc4fc857a6fea72d69204cf Signed-off-by: Robert Varga --- .../md-sal/benchmark-data-store/pom.xml | 92 ------------- ...MemoryBrokerWriteTransactionBenchmark.java | 112 ---------------- ...oryDatastoreWriteTransactionBenchmark.java | 124 ------------------ ...ractInMemoryWriteTransactionBenchmark.java | 87 ------------ .../dom/store/benchmark/BenchmarkModel.java | 42 ------ ...MemoryBrokerWriteTransactionBenchmark.java | 63 --------- ...toreWithSameThreadedExecutorBenchmark.java | 62 --------- ...oryDataStoreWriteTransactionBenchmark.java | 52 -------- .../main/resources/odl-datastore-test.yang | 42 ------ opendaylight/md-sal/pom.xml | 12 -- 10 files changed, 688 deletions(-) delete mode 100644 opendaylight/md-sal/benchmark-data-store/pom.xml delete mode 100644 opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryBrokerWriteTransactionBenchmark.java delete mode 100644 opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryDatastoreWriteTransactionBenchmark.java delete mode 100644 opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryWriteTransactionBenchmark.java delete mode 100644 opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/BenchmarkModel.java delete mode 100644 opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryBrokerWriteTransactionBenchmark.java delete mode 100644 opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithSameThreadedExecutorBenchmark.java delete mode 100644 opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWriteTransactionBenchmark.java delete mode 100644 opendaylight/md-sal/benchmark-data-store/src/main/resources/odl-datastore-test.yang diff --git a/opendaylight/md-sal/benchmark-data-store/pom.xml b/opendaylight/md-sal/benchmark-data-store/pom.xml deleted file mode 100644 index 1c4dea6640..0000000000 --- a/opendaylight/md-sal/benchmark-data-store/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.opendaylight.controller - mdsal-parent - 1.12.0-SNAPSHOT - ../parent - - - org.opendaylight.controller - benchmark-data-store - 1.12.0-SNAPSHOT - jar - - - true - - - - - org.opendaylight.yangtools - yang-data-impl - - - org.openjdk.jmh - jmh-core - 1.23 - - - org.opendaylight.mdsal - mdsal-dom-inmemory-datastore - - - org.opendaylight.mdsal - mdsal-dom-broker - - - org.opendaylight.yangtools - yang-test-util - compile - - - - - - - maven-compiler-plugin - - - - org.openjdk.jmh - jmh-generator-annprocess - 1.23 - - - - - - org.codehaus.mojo - exec-maven-plugin - - test - java - - -classpath - - org.openjdk.jmh.Main - .* - - - - - run-benchmarks - integration-test - - exec - - - - - - - diff --git a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryBrokerWriteTransactionBenchmark.java b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryBrokerWriteTransactionBenchmark.java deleted file mode 100644 index c9836ded43..0000000000 --- a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryBrokerWriteTransactionBenchmark.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.md.sal.dom.store.benchmark; - -import java.util.concurrent.TimeUnit; -import org.opendaylight.mdsal.common.api.LogicalDatastoreType; -import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction; -import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.Measurement; -import org.openjdk.jmh.annotations.Warmup; - -/** - * Abstract class to handle transaction benchmarks. - * - * @author Lukas Sedlak - */ -public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark - extends AbstractInMemoryWriteTransactionBenchmark { - - protected SerializedDOMDataBroker domBroker; - - protected void initTestNode() throws Exception { - final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build(); - DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction(); - writeTx.put(LogicalDatastoreType.OPERATIONAL, testPath, provideOuterListNode()); - - writeTx.commit().get(); - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write100KSingleNodeWithOneInnerItemInOneCommitBenchmark() throws Exception { - - DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction(); - for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) { - writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey], - OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]); - } - - writeTx.commit().get(); - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception { - for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) { - DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction(); - writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey], - OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]); - - writeTx.commit().get(); - } - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception { - DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction(); - for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) { - writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey], - OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]); - } - - writeTx.commit().get(); - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark() throws Exception { - for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) { - DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction(); - writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey], - OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]); - writeTx.commit().get(); - } - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark() throws Exception { - DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction(); - for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) { - writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey], - OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]); - } - writeTx.commit().get(); - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write10KSingleNodeWithTenInnerItemsInCommitPerWriteBenchmark() throws Exception { - for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) { - DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction(); - writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey], - OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]); - writeTx.commit().get(); - } - } -} diff --git a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryDatastoreWriteTransactionBenchmark.java b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryDatastoreWriteTransactionBenchmark.java deleted file mode 100644 index 473da352fa..0000000000 --- a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryDatastoreWriteTransactionBenchmark.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.md.sal.dom.store.benchmark; - -import java.util.concurrent.TimeUnit; -import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction; -import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort; -import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.Measurement; -import org.openjdk.jmh.annotations.Warmup; - -/** - * Abstract class for in-memory Datastore transaction benchmarks. - * - * @author Lukas Sedlak - */ -public abstract class AbstractInMemoryDatastoreWriteTransactionBenchmark - extends AbstractInMemoryWriteTransactionBenchmark { - - protected InMemoryDOMDataStore domStore; - - protected void initTestNode() throws Exception { - final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build(); - DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction(); - writeTx.write(testPath, provideOuterListNode()); - - DOMStoreThreePhaseCommitCohort cohort = writeTx.ready(); - cohort.canCommit().get(); - cohort.preCommit().get(); - cohort.commit().get(); - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write100KSingleNodeWithOneInnerItemInOneCommitBenchmark() throws Exception { - DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction(); - for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) { - writeTx.write(OUTER_LIST_100K_PATHS[outerListKey], OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]); - } - DOMStoreThreePhaseCommitCohort cohort = writeTx.ready(); - cohort.canCommit().get(); - cohort.preCommit().get(); - cohort.commit().get(); - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception { - for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) { - DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction(); - writeTx.write(OUTER_LIST_100K_PATHS[outerListKey], OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]); - - DOMStoreThreePhaseCommitCohort cohort = writeTx.ready(); - cohort.canCommit().get(); - cohort.preCommit().get(); - cohort.commit().get(); - } - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception { - DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction(); - for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) { - writeTx.write(OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]); - } - DOMStoreThreePhaseCommitCohort cohort = writeTx.ready(); - cohort.canCommit().get(); - cohort.preCommit().get(); - cohort.commit().get(); - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark() throws Exception { - for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) { - DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction(); - writeTx.write(OUTER_LIST_50K_PATHS[outerListKey], OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]); - DOMStoreThreePhaseCommitCohort cohort = writeTx.ready(); - cohort.canCommit().get(); - cohort.preCommit().get(); - cohort.commit().get(); - } - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark() throws Exception { - DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction(); - for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) { - writeTx.write(OUTER_LIST_10K_PATHS[outerListKey], OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]); - } - DOMStoreThreePhaseCommitCohort cohort = writeTx.ready(); - cohort.canCommit().get(); - cohort.preCommit().get(); - cohort.commit().get(); - } - - @Benchmark - @Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - @Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS) - public void write10KSingleNodeWithTenInnerItemsInCommitPerWriteBenchmark() throws Exception { - for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) { - DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction(); - writeTx.write(OUTER_LIST_10K_PATHS[outerListKey], OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]); - DOMStoreThreePhaseCommitCohort cohort = writeTx.ready(); - cohort.canCommit().get(); - cohort.preCommit().get(); - cohort.commit().get(); - } - } -} diff --git a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryWriteTransactionBenchmark.java b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryWriteTransactionBenchmark.java deleted file mode 100644 index 1a20e422d6..0000000000 --- a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryWriteTransactionBenchmark.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.md.sal.dom.store.benchmark; - -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; -import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; -import org.opendaylight.yangtools.yang.data.api.schema.MapNode; -import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; -import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder; -import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder; -import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; - -public abstract class AbstractInMemoryWriteTransactionBenchmark { - protected static final int OUTER_LIST_100K = 100000; - protected static final int OUTER_LIST_50K = 50000; - protected static final int OUTER_LIST_10K = 10000; - - protected static final YangInstanceIdentifier[] OUTER_LIST_100K_PATHS = initOuterListPaths(OUTER_LIST_100K); - protected static final YangInstanceIdentifier[] OUTER_LIST_50K_PATHS = initOuterListPaths(OUTER_LIST_50K); - protected static final YangInstanceIdentifier[] OUTER_LIST_10K_PATHS = initOuterListPaths(OUTER_LIST_10K); - - private static YangInstanceIdentifier[] initOuterListPaths(final int outerListPathsCount) { - final YangInstanceIdentifier[] paths = new YangInstanceIdentifier[outerListPathsCount]; - - for (int outerListKey = 0; outerListKey < outerListPathsCount; ++outerListKey) { - paths[outerListKey] = YangInstanceIdentifier.builder(BenchmarkModel.OUTER_LIST_PATH) - .nodeWithKey(BenchmarkModel.OUTER_LIST_QNAME, BenchmarkModel.ID_QNAME, outerListKey).build(); - } - return paths; - } - - protected static final int WARMUP_ITERATIONS = 6; - protected static final int MEASUREMENT_ITERATIONS = 6; - - protected static final MapNode ONE_ITEM_INNER_LIST = initInnerListItems(1); - protected static final MapNode TWO_ITEM_INNER_LIST = initInnerListItems(2); - protected static final MapNode TEN_ITEM_INNER_LIST = initInnerListItems(10); - - private static MapNode initInnerListItems(final int count) { - final CollectionNodeBuilder mapEntryBuilder = ImmutableNodes - .mapNodeBuilder(BenchmarkModel.INNER_LIST_QNAME); - - for (int i = 1; i <= count; ++i) { - mapEntryBuilder - .withChild(ImmutableNodes.mapEntry(BenchmarkModel.INNER_LIST_QNAME, BenchmarkModel.NAME_QNAME, i)); - } - return mapEntryBuilder.build(); - } - - protected static final NormalizedNode[] OUTER_LIST_ONE_ITEM_INNER_LIST = initOuterListItems(OUTER_LIST_100K, - ONE_ITEM_INNER_LIST); - protected static final NormalizedNode[] OUTER_LIST_TWO_ITEM_INNER_LIST = initOuterListItems(OUTER_LIST_50K, - TWO_ITEM_INNER_LIST); - protected static final NormalizedNode[] OUTER_LIST_TEN_ITEM_INNER_LIST = initOuterListItems(OUTER_LIST_10K, - TEN_ITEM_INNER_LIST); - - private static NormalizedNode[] initOuterListItems(final int outerListItemsCount, final MapNode innerList) { - final NormalizedNode[] outerListItems = new NormalizedNode[outerListItemsCount]; - - for (int i = 0; i < outerListItemsCount; ++i) { - int outerListKey = i; - outerListItems[i] = ImmutableNodes - .mapEntryBuilder(BenchmarkModel.OUTER_LIST_QNAME, BenchmarkModel.ID_QNAME, outerListKey) - .withChild(innerList).build(); - } - return outerListItems; - } - - protected EffectiveModelContext schemaContext; - - public abstract void setUp() throws Exception; - - public abstract void tearDown(); - - protected static DataContainerChild provideOuterListNode() { - return ImmutableContainerNodeBuilder.create() - .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(BenchmarkModel.TEST_QNAME)) - .withChild(ImmutableNodes.mapNodeBuilder(BenchmarkModel.OUTER_LIST_QNAME).build()).build(); - } -} diff --git a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/BenchmarkModel.java b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/BenchmarkModel.java deleted file mode 100644 index e1effd918a..0000000000 --- a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/BenchmarkModel.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.md.sal.dom.store.benchmark; - -import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; -import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils; - -/** - * Benchmark Model class loads the odl-datastore-test.yang model from resources. - *
- * This class serves as facilitator class which holds several references to initialized yang model as static final - * members. - * - * @author Lukas Sedlak - */ -public final class BenchmarkModel { - - public static final QName TEST_QNAME = QName - .create("urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test", "2014-03-13","test"); - public static final QName OUTER_LIST_QNAME = QName.create(TEST_QNAME, "outer-list"); - public static final QName INNER_LIST_QNAME = QName.create(TEST_QNAME, "inner-list"); - public static final QName ID_QNAME = QName.create(TEST_QNAME, "id"); - public static final QName NAME_QNAME = QName.create(TEST_QNAME, "name"); - private static final String DATASTORE_TEST_YANG = "/odl-datastore-test.yang"; - public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier.of(TEST_QNAME); - public static final YangInstanceIdentifier OUTER_LIST_PATH = - YangInstanceIdentifier.builder(TEST_PATH).node(OUTER_LIST_QNAME).build(); - - private BenchmarkModel() { - } - - public static EffectiveModelContext createTestContext() { - return YangParserTestUtils.parseYangResources(BenchmarkModel.class, DATASTORE_TEST_YANG); - } -} diff --git a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryBrokerWriteTransactionBenchmark.java b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryBrokerWriteTransactionBenchmark.java deleted file mode 100644 index eeeebc85f9..0000000000 --- a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryBrokerWriteTransactionBenchmark.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.md.sal.dom.store.benchmark; - -import com.google.common.collect.ImmutableMap; -import com.google.common.util.concurrent.ListeningExecutorService; -import com.google.common.util.concurrent.MoreExecutors; -import java.util.Map; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import org.opendaylight.mdsal.common.api.LogicalDatastoreType; -import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker; -import org.opendaylight.mdsal.dom.spi.store.DOMStore; -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.State; - -@State(Scope.Thread) -@BenchmarkMode(Mode.AverageTime) -@OutputTimeUnit(TimeUnit.MILLISECONDS) -@Fork(1) -public class InMemoryBrokerWriteTransactionBenchmark extends AbstractInMemoryBrokerWriteTransactionBenchmark { - private ListeningExecutorService executor = null; - - @Setup(Level.Trial) - @Override - public void setUp() throws Exception { - ListeningExecutorService dsExec = MoreExecutors.newDirectExecutorService(); - executor = MoreExecutors.listeningDecorator( - MoreExecutors.getExitingExecutorService((ThreadPoolExecutor) Executors.newFixedThreadPool(1), 1L, - TimeUnit.SECONDS)); - - InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", dsExec); - InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", dsExec); - Map datastores = ImmutableMap.of( - LogicalDatastoreType.OPERATIONAL, (DOMStore)operStore, - LogicalDatastoreType.CONFIGURATION, configStore); - - domBroker = new SerializedDOMDataBroker(datastores, executor); - schemaContext = BenchmarkModel.createTestContext(); - configStore.onModelContextUpdated(schemaContext); - operStore.onModelContextUpdated(schemaContext); - initTestNode(); - } - - @Override - public void tearDown() { - domBroker.close(); - executor.shutdown(); - } -} diff --git a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithSameThreadedExecutorBenchmark.java b/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithSameThreadedExecutorBenchmark.java deleted file mode 100644 index 9d285985c3..0000000000 --- a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithSameThreadedExecutorBenchmark.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.md.sal.dom.store.benchmark; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; -import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore; -import org.opendaylight.yangtools.util.concurrent.SpecialExecutors; -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.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 Blocking Bounded Fast Thread Pool - * and DOM Store Executor Service as Same Thread Executor. - * - * @author Lukas Sedlak - */ -@State(Scope.Thread) -@BenchmarkMode(Mode.AverageTime) -@OutputTimeUnit(TimeUnit.MILLISECONDS) -@Fork(1) -public class InMemoryDataStoreWithSameThreadedExecutorBenchmark - extends AbstractInMemoryDatastoreWriteTransactionBenchmark { - - private static final int MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE = 20; - private static final int MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE = 1000; - - @Override - @Setup(Level.Trial) - public void setUp() throws Exception { - final String name = "DS_BENCHMARK"; - final ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool( - MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE, MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE, name + "-DCL", - InMemoryDataStoreWithSameThreadedExecutorBenchmark.class); - - domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", dataChangeListenerExecutor); - schemaContext = BenchmarkModel.createTestContext(); - domStore.onModelContextUpdated(schemaContext); - initTestNode(); - } - - @Override - @TearDown - public void tearDown() { - schemaContext = null; - domStore = null; - } -} 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 deleted file mode 100644 index 937fc67588..0000000000 --- a/opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWriteTransactionBenchmark.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.md.sal.dom.store.benchmark; - -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -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.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. - * - * @author Lukas Sedlak - */ -@State(Scope.Thread) -@BenchmarkMode(Mode.AverageTime) -@OutputTimeUnit(TimeUnit.MILLISECONDS) -@Fork(1) -public class InMemoryDataStoreWriteTransactionBenchmark extends AbstractInMemoryDatastoreWriteTransactionBenchmark { - - @Override - @Setup(Level.Trial) - public void setUp() throws Exception { - domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", Executors.newSingleThreadExecutor()); - schemaContext = BenchmarkModel.createTestContext(); - domStore.onModelContextUpdated(schemaContext); - initTestNode(); - } - - @Override - @TearDown - public void tearDown() { - schemaContext = null; - domStore = null; - } -} diff --git a/opendaylight/md-sal/benchmark-data-store/src/main/resources/odl-datastore-test.yang b/opendaylight/md-sal/benchmark-data-store/src/main/resources/odl-datastore-test.yang deleted file mode 100644 index 730ca17173..0000000000 --- a/opendaylight/md-sal/benchmark-data-store/src/main/resources/odl-datastore-test.yang +++ /dev/null @@ -1,42 +0,0 @@ -module odl-datastore-test { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:store:test"; - prefix "store-test"; - - revision "2014-03-13" { - description "Initial revision."; - } - - container test { - list outer-list { - key id; - leaf id { - type int32; - } - choice outer-choice { - case one { - leaf one { - type string; - } - } - case two-three { - leaf two { - type string; - } - leaf three { - type string; - } - } - } - list inner-list { - key name; - leaf name { - type int32; - } - leaf value { - type string; - } - } - } - } -} \ No newline at end of file diff --git a/opendaylight/md-sal/pom.xml b/opendaylight/md-sal/pom.xml index ac63c3ef45..3d4098dbec 100644 --- a/opendaylight/md-sal/pom.xml +++ b/opendaylight/md-sal/pom.xml @@ -66,16 +66,4 @@ mdsal-it-base mdsal-it-parent - - - - benchmarks - - false - - - benchmark-data-store - - - -- 2.36.6