Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support packaging a subset of benchmark drivers #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 3 additions & 81 deletions benchmark-framework/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,87 +87,9 @@
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-pulsar</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-jms</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-kafka</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-redpanda</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-kop</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-pravega</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-rocketmq</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-rabbitmq</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-artemis</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-bookkeeper</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-nats</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-nats-streaming</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-nsq</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>driver-redis</artifactId>
<version>${project.version}</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.openmessaging.benchmark.utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Stream;

public class FutureUtil {

/*
Originally from the Apache Pulsar project
https://github.com/apache/pulsar/blob/master/pulsar-common/src/main/java/org/apache/pulsar/common/util/FutureUtil.java
*/
public static CompletableFuture<Void> waitForAll(Collection<? extends CompletableFuture<?>> futures) {
return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
}

/*
Originally from the Apache Pulsar project
https://github.com/apache/pulsar/blob/master/pulsar-common/src/main/java/org/apache/pulsar/common/util/FutureUtil.java
*/
public static <T> CompletableFuture<List<T>> waitForAll(Stream<CompletableFuture<List<T>>> futures) {
return futures.reduce(CompletableFuture.completedFuture(new ArrayList<>()),
(pre, curr) -> pre.thenCompose(preV -> curr.thenApply(currV -> {
preV.addAll(currV);
return preV;
})));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
import com.google.common.collect.Lists;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import io.openmessaging.benchmark.utils.FutureUtil;
import io.openmessaging.benchmark.utils.ListPartition;
import io.openmessaging.benchmark.worker.commands.*;
import org.HdrHistogram.Histogram;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.commons.lang3.tuple.Triple;
import org.apache.pulsar.common.util.FutureUtil;
import org.asynchttpclient.AsyncHttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.fasterxml.jackson.core.type.TypeReference;

import org.HdrHistogram.Histogram;
import org.apache.pulsar.common.util.FutureUtil;
import org.asynchttpclient.AsyncHttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -46,6 +45,7 @@

import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import io.openmessaging.benchmark.utils.FutureUtil;
import io.openmessaging.benchmark.worker.commands.ConsumerAssignment;
import io.openmessaging.benchmark.worker.commands.CountersStats;
import io.openmessaging.benchmark.worker.commands.CumulativeLatencies;
Expand Down
2 changes: 1 addition & 1 deletion driver-redpanda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

## Setup

1. In the top level directory run `mvn clean install -Dlicense.skip=true`. This will build the benchmark client needed during deployment.
1. In the top level directory run `mvn clean install -Dlicense.skip=true -pl '.,benchmark-framework,driver-api,driver-redpanda,package'`. This will build the benchmark client needed during deployment.

2. Create an ssh key for the benchmark using the following: `ssh-keygen -f ~/.ssh/redpanda_aws`. Set the password to blank.

Expand Down
64 changes: 35 additions & 29 deletions package/src/assemble/bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,41 @@
<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>*:*</include>
</includes>
<binaries>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
<!-- Include 'groupId' in the modules Jar names to better identify
the provenance of the jar -->
<outputFileNameMapping>${module.groupId}-${module.artifactId}-${module.version}${dashClassifier?}.${module.extension}</outputFileNameMapping>
<dependencySets>
<dependencySet>
<scope>compile</scope>
<useProjectArtifact>false</useProjectArtifact>
<!-- Include 'groupId' in the dependencies Jar names to better identify
the provenance of the jar -->
<outputFileNameMapping>${artifact.groupId}-${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<excludes>
<!-- All these dependencies are already included in netty-all -->
<exclude>io.netty:netty-buffer</exclude>
<exclude>io.netty:netty-codec</exclude>
<exclude>io.netty:netty-codec-dns</exclude>
<exclude>io.netty:netty-codec-http</exclude>
<exclude>io.netty:netty-common</exclude>
<exclude>io.netty:netty-handler</exclude>
<exclude>io.netty:netty-transport</exclude>
<exclude>io.netty:netty-resolver</exclude>
<exclude>io.netty:netty-resolver-dns</exclude>
<exclude>io.netty:netty-transport-native-epoll</exclude>
<exclude>io.netty:netty-transport-native-kqueue</exclude>
<exclude>io.netty:netty-transport-native-unix-common</exclude>
<exclude>ch.qos.logback:*</exclude>
</excludes>
</dependencySet>
</dependencySets>
</binaries>
</moduleSet>
</moduleSets>

Expand Down Expand Up @@ -69,33 +104,4 @@
<fileMode>644</fileMode>
</file>
</files>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
<scope>compile</scope>
<useProjectArtifact>false</useProjectArtifact>
<!-- Include 'groupId' in the dependencies Jar names to better identify
the provenance of the jar -->
<outputFileNameMapping>${artifact.groupId}-${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>

<excludes>
<!-- All these dependencies are already included in netty-all -->
<exclude>io.netty:netty-common</exclude>
<exclude>io.netty:netty-buffer</exclude>
<exclude>io.netty:netty-codec-http</exclude>
<exclude>io.netty:netty-codec</exclude>
<exclude>io.netty:netty-transport</exclude>
<exclude>io.netty:netty-handler</exclude>
<exclude>io.netty:netty-transport-native-epoll</exclude>
<exclude>io.netty:netty-transport-native-kqueue</exclude>
<exclude>io.netty:netty-codec-http</exclude>
<exclude>io.netty:netty-codec-dns</exclude>
<exclude>io.netty:netty-resolver</exclude>
<exclude>io.netty:netty-resolver-dns</exclude>
<exclude>io.netty:netty-transport-native-unix-common</exclude>
<exclude>ch.qos.logback:*</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
<module>driver-nsq</module>
<module>driver-jms</module>
<module>driver-redis</module>
<module>driver-kop</module>
<module>package</module>
<module>deployment</module>
<module>docker</module>
<module>driver-kop</module>
</modules>


Expand Down