From f3fb77f4bce9d11d7b54878e91728674f6ee5342 Mon Sep 17 00:00:00 2001 From: Louis Ryan Date: Mon, 13 Apr 2015 15:45:48 -0700 Subject: [PATCH] Have microbenchmarks produce a deployable artifact. Fix some minor miscellaneous issues. Motivation: Allows for running benchmarks from built jars which is useful in development environments that only take released artifacts. Modifications: Move benchmarks into 'main' from 'test' Add @State annotations to benchmarks that are missing them Fix timing issue grabbing context during channel initialization Result: Users can run benchmarks more easily. --- microbench/pom.xml | 59 ++++++++++++++----- .../buffer/ByteBufAllocatorBenchmark.java | 3 + .../buffer/ByteBufUtilBenchmark.java | 0 .../buffer/SwappedByteBufBenchmark.java | 0 .../netty/microbench/buffer/package-info.java | 19 ++++++ ...ddedChannelWriteReleaseHandlerContext.java | 0 .../microbench/channel/package-info.java | 19 ++++++ .../concurrent/FastThreadLocalBenchmark.java | 0 .../microbench/concurrent/package-info.java | 19 ++++++ .../http/HttpRequestDecoderBenchmark.java | 0 .../netty/microbench/http/package-info.java | 19 ++++++ .../http2/Http2FrameWriterBenchmark.java | 33 +++++++---- .../http2/NoopHttp2LocalFlowController.java | 0 .../http2/NoopHttp2RemoteFlowController.java | 0 .../netty/microbench/http2/package-info.java | 19 ++++++ .../internal/PlatformDependentBenchmark.java | 0 .../RecyclableArrayListBenchmark.java | 3 + .../microbench/internal/package-info.java | 19 ++++++ .../util/AbstractMicrobenchmark.java | 2 +- .../util/AbstractMicrobenchmarkBase.java | 0 .../AbstractSharedExecutorMicrobenchmark.java | 2 +- .../netty/microbench/util/package-info.java | 19 ++++++ .../common/IntObjectHashMapBenchmark.java | 0 .../common/NetUtilBenchmark.java | 0 .../microbenchmark/common/package-info.java | 19 ++++++ .../src/{test => main}/resources/logback.xml | 0 26 files changed, 227 insertions(+), 27 deletions(-) rename microbench/src/{test => main}/java/io/netty/microbench/buffer/ByteBufAllocatorBenchmark.java (97%) rename microbench/src/{test => main}/java/io/netty/microbench/buffer/ByteBufUtilBenchmark.java (100%) rename microbench/src/{test => main}/java/io/netty/microbench/buffer/SwappedByteBufBenchmark.java (100%) create mode 100644 microbench/src/main/java/io/netty/microbench/buffer/package-info.java rename microbench/src/{test => main}/java/io/netty/microbench/channel/EmbeddedChannelWriteReleaseHandlerContext.java (100%) create mode 100644 microbench/src/main/java/io/netty/microbench/channel/package-info.java rename microbench/src/{test => main}/java/io/netty/microbench/concurrent/FastThreadLocalBenchmark.java (100%) create mode 100644 microbench/src/main/java/io/netty/microbench/concurrent/package-info.java rename microbench/src/{test => main}/java/io/netty/microbench/http/HttpRequestDecoderBenchmark.java (100%) create mode 100644 microbench/src/main/java/io/netty/microbench/http/package-info.java rename microbench/src/{test => main}/java/io/netty/microbench/http2/Http2FrameWriterBenchmark.java (95%) rename microbench/src/{test => main}/java/io/netty/microbench/http2/NoopHttp2LocalFlowController.java (100%) rename microbench/src/{test => main}/java/io/netty/microbench/http2/NoopHttp2RemoteFlowController.java (100%) create mode 100644 microbench/src/main/java/io/netty/microbench/http2/package-info.java rename microbench/src/{test => main}/java/io/netty/microbench/internal/PlatformDependentBenchmark.java (100%) rename microbench/src/{test => main}/java/io/netty/microbench/internal/RecyclableArrayListBenchmark.java (92%) create mode 100644 microbench/src/main/java/io/netty/microbench/internal/package-info.java rename microbench/src/{test => main}/java/io/netty/microbench/util/AbstractMicrobenchmark.java (96%) rename microbench/src/{test => main}/java/io/netty/microbench/util/AbstractMicrobenchmarkBase.java (100%) rename microbench/src/{test => main}/java/io/netty/microbench/util/AbstractSharedExecutorMicrobenchmark.java (97%) create mode 100644 microbench/src/main/java/io/netty/microbench/util/package-info.java rename microbench/src/{test => main}/java/io/netty/microbenchmark/common/IntObjectHashMapBenchmark.java (100%) rename microbench/src/{test => main}/java/io/netty/microbenchmark/common/NetUtilBenchmark.java (100%) create mode 100644 microbench/src/main/java/io/netty/microbenchmark/common/package-info.java rename microbench/src/{test => main}/resources/logback.xml (100%) diff --git a/microbench/pom.xml b/microbench/pom.xml index d3aaa8de43..3cf4fc2b98 100644 --- a/microbench/pom.xml +++ b/microbench/pom.xml @@ -64,12 +64,17 @@ netty-codec-http2 ${project.version} - - ${project.groupId} - netty-transport-native-epoll - ${project.version} - linux-${epoll.arch} - + + ${project.groupId} + netty-transport-native-epoll + ${project.version} + linux-${epoll.arch} + + + junit + junit + compile + org.openjdk.jmh jmh-core @@ -90,25 +95,49 @@ - - maven-deploy-plugin - - true - - org.apache.maven.plugins maven-surefire-plugin + ${project.build.sourceDirectory} + ${project.build.outputDirectory} **/AbstractMicrobenchmark.java **/*$*.class + **/generated/*.class - - ${project.build.directory}/reports/performance/ - + + ${project.build.directory}/reports/performance/ + + + org.apache.felix + maven-bundle-plugin + + + generate-manifest + process-classes + + manifest + + + + jar + bundle + + + ${project.groupId}.* + !*.generated.* + + sun.nio.ch;resolution:=optional,org.eclipse.jetty.npn;version="[1,2)";resolution:=optional,org.eclipse.jetty.alpn;version="[1,2)";resolution:=optional,* + + !* + + + + + diff --git a/microbench/src/test/java/io/netty/microbench/buffer/ByteBufAllocatorBenchmark.java b/microbench/src/main/java/io/netty/microbench/buffer/ByteBufAllocatorBenchmark.java similarity index 97% rename from microbench/src/test/java/io/netty/microbench/buffer/ByteBufAllocatorBenchmark.java rename to microbench/src/main/java/io/netty/microbench/buffer/ByteBufAllocatorBenchmark.java index 252d0d3b30..a2e7b6ea2e 100644 --- a/microbench/src/test/java/io/netty/microbench/buffer/ByteBufAllocatorBenchmark.java +++ b/microbench/src/main/java/io/netty/microbench/buffer/ByteBufAllocatorBenchmark.java @@ -22,12 +22,15 @@ import io.netty.buffer.UnpooledByteBufAllocator; import io.netty.microbench.util.AbstractMicrobenchmark; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; import java.util.Random; /** * This class benchmarks different allocators with different allocation sizes. */ +@State(Scope.Benchmark) public class ByteBufAllocatorBenchmark extends AbstractMicrobenchmark { private static final ByteBufAllocator unpooledAllocator = new UnpooledByteBufAllocator(true); diff --git a/microbench/src/test/java/io/netty/microbench/buffer/ByteBufUtilBenchmark.java b/microbench/src/main/java/io/netty/microbench/buffer/ByteBufUtilBenchmark.java similarity index 100% rename from microbench/src/test/java/io/netty/microbench/buffer/ByteBufUtilBenchmark.java rename to microbench/src/main/java/io/netty/microbench/buffer/ByteBufUtilBenchmark.java diff --git a/microbench/src/test/java/io/netty/microbench/buffer/SwappedByteBufBenchmark.java b/microbench/src/main/java/io/netty/microbench/buffer/SwappedByteBufBenchmark.java similarity index 100% rename from microbench/src/test/java/io/netty/microbench/buffer/SwappedByteBufBenchmark.java rename to microbench/src/main/java/io/netty/microbench/buffer/SwappedByteBufBenchmark.java diff --git a/microbench/src/main/java/io/netty/microbench/buffer/package-info.java b/microbench/src/main/java/io/netty/microbench/buffer/package-info.java new file mode 100644 index 0000000000..cc1c001497 --- /dev/null +++ b/microbench/src/main/java/io/netty/microbench/buffer/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2015 The Netty Project + * + * The Netty Project licenses this file to you 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. + */ +/** + * Benchmarks for {@link io.netty.buffer}. + */ +package io.netty.microbench.buffer; diff --git a/microbench/src/test/java/io/netty/microbench/channel/EmbeddedChannelWriteReleaseHandlerContext.java b/microbench/src/main/java/io/netty/microbench/channel/EmbeddedChannelWriteReleaseHandlerContext.java similarity index 100% rename from microbench/src/test/java/io/netty/microbench/channel/EmbeddedChannelWriteReleaseHandlerContext.java rename to microbench/src/main/java/io/netty/microbench/channel/EmbeddedChannelWriteReleaseHandlerContext.java diff --git a/microbench/src/main/java/io/netty/microbench/channel/package-info.java b/microbench/src/main/java/io/netty/microbench/channel/package-info.java new file mode 100644 index 0000000000..fa1137a0ce --- /dev/null +++ b/microbench/src/main/java/io/netty/microbench/channel/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2015 The Netty Project + * + * The Netty Project licenses this file to you 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. + */ +/** + * Benchmarks for {@link io.netty.channel}. + */ +package io.netty.microbench.channel; diff --git a/microbench/src/test/java/io/netty/microbench/concurrent/FastThreadLocalBenchmark.java b/microbench/src/main/java/io/netty/microbench/concurrent/FastThreadLocalBenchmark.java similarity index 100% rename from microbench/src/test/java/io/netty/microbench/concurrent/FastThreadLocalBenchmark.java rename to microbench/src/main/java/io/netty/microbench/concurrent/FastThreadLocalBenchmark.java diff --git a/microbench/src/main/java/io/netty/microbench/concurrent/package-info.java b/microbench/src/main/java/io/netty/microbench/concurrent/package-info.java new file mode 100644 index 0000000000..40d63c9d1b --- /dev/null +++ b/microbench/src/main/java/io/netty/microbench/concurrent/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2015 The Netty Project + * + * The Netty Project licenses this file to you 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. + */ +/** + * Benchmarks for {@link io.netty.util.concurrent}. + */ +package io.netty.microbench.concurrent; diff --git a/microbench/src/test/java/io/netty/microbench/http/HttpRequestDecoderBenchmark.java b/microbench/src/main/java/io/netty/microbench/http/HttpRequestDecoderBenchmark.java similarity index 100% rename from microbench/src/test/java/io/netty/microbench/http/HttpRequestDecoderBenchmark.java rename to microbench/src/main/java/io/netty/microbench/http/HttpRequestDecoderBenchmark.java diff --git a/microbench/src/main/java/io/netty/microbench/http/package-info.java b/microbench/src/main/java/io/netty/microbench/http/package-info.java new file mode 100644 index 0000000000..89ca2fc4f1 --- /dev/null +++ b/microbench/src/main/java/io/netty/microbench/http/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2015 The Netty Project + * + * The Netty Project licenses this file to you 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. + */ +/** + * Benchmarks for {@link io.netty.handler.codec.http}. + */ +package io.netty.microbench.http; diff --git a/microbench/src/test/java/io/netty/microbench/http2/Http2FrameWriterBenchmark.java b/microbench/src/main/java/io/netty/microbench/http2/Http2FrameWriterBenchmark.java similarity index 95% rename from microbench/src/test/java/io/netty/microbench/http2/Http2FrameWriterBenchmark.java rename to microbench/src/main/java/io/netty/microbench/http2/Http2FrameWriterBenchmark.java index a4ac332a76..baec070778 100644 --- a/microbench/src/test/java/io/netty/microbench/http2/Http2FrameWriterBenchmark.java +++ b/microbench/src/main/java/io/netty/microbench/http2/Http2FrameWriterBenchmark.java @@ -18,6 +18,8 @@ import static io.netty.handler.codec.http2.Http2CodecUtil.DEFAULT_MAX_FRAME_SIZE import static io.netty.handler.codec.http2.Http2CodecUtil.MAX_FRAME_SIZE_UPPER_BOUND; import static io.netty.util.internal.ObjectUtil.checkNotNull; import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; + import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; import io.netty.buffer.ByteBuf; @@ -66,6 +68,7 @@ import io.netty.util.concurrent.Future; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.Random; +import java.util.concurrent.CountDownLatch; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Level; @@ -127,13 +130,13 @@ public class Http2FrameWriterBenchmark extends AbstractSharedExecutorMicrobenchm @Setup(Level.Trial) public void setup() { switch (environmentType) { - case EMBEDDED_POOLED: - case EMBEDDED_UNPOOLED: - environment = boostrapEmbeddedEnv(environmentType); - break; - default: - environment = boostrapEnvWithTransport(environmentType); - break; + case EMBEDDED_POOLED: + case EMBEDDED_UNPOOLED: + environment = boostrapEmbeddedEnv(environmentType); + break; + default: + environment = boostrapEnvWithTransport(environmentType); + break; } if (environment == null) { throw new IllegalStateException("Environment type [" + environmentType + "] is not supported."); @@ -226,7 +229,7 @@ public class Http2FrameWriterBenchmark extends AbstractSharedExecutorMicrobenchm final EnvironmentParameters params = environmentType.params(); ServerBootstrap sb = new ServerBootstrap(); Bootstrap cb = new Bootstrap(); - final TrasportEnvironment environment = new TrasportEnvironment(cb, sb); + final TransportEnvironment environment = new TransportEnvironment(cb, sb); EventLoopGroup serverEventLoopGroup = params.newEventLoopGroup(); sb.group(serverEventLoopGroup, serverEventLoopGroup); @@ -242,6 +245,7 @@ public class Http2FrameWriterBenchmark extends AbstractSharedExecutorMicrobenchm cb.group(params.newEventLoopGroup()); cb.channel(params.clientChannelClass()); cb.option(ChannelOption.ALLOCATOR, params.clientAllocator()); + final CountDownLatch latch = new CountDownLatch(1); cb.handler(new ChannelInitializer() { @Override protected void initChannel(Channel ch) throws Exception { @@ -263,12 +267,21 @@ public class Http2FrameWriterBenchmark extends AbstractSharedExecutorMicrobenchm Http2ConnectionHandler connectionHandler = new Http2ConnectionHandler(decoder, encoder); p.addLast(connectionHandler); environment.context(p.lastContext()); + // Must wait for context to be set. + latch.countDown(); } }); environment.serverChannel(sb.bind(params.address())); params.address(environment.serverChannel().localAddress()); environment.clientChannel(cb.connect(params.address())); + try { + if (!latch.await(5, SECONDS)) { + throw new RuntimeException("Channel did not initialize in time"); + } + } catch (InterruptedException ie) { + throw new RuntimeException(ie); + } return environment; } @@ -437,7 +450,7 @@ public class Http2FrameWriterBenchmark extends AbstractSharedExecutorMicrobenchm } } - private static final class TrasportEnvironment implements Environment { + private static final class TransportEnvironment implements Environment { private final ServerBootstrap sb; private final Bootstrap cb; private Channel serverChannel; @@ -445,7 +458,7 @@ public class Http2FrameWriterBenchmark extends AbstractSharedExecutorMicrobenchm private ChannelHandlerContext clientContext; private Http2FrameWriter clientWriter; - public TrasportEnvironment(Bootstrap cb, ServerBootstrap sb) { + public TransportEnvironment(Bootstrap cb, ServerBootstrap sb) { this.sb = checkNotNull(sb, "sb"); this.cb = checkNotNull(cb, "cb"); } diff --git a/microbench/src/test/java/io/netty/microbench/http2/NoopHttp2LocalFlowController.java b/microbench/src/main/java/io/netty/microbench/http2/NoopHttp2LocalFlowController.java similarity index 100% rename from microbench/src/test/java/io/netty/microbench/http2/NoopHttp2LocalFlowController.java rename to microbench/src/main/java/io/netty/microbench/http2/NoopHttp2LocalFlowController.java diff --git a/microbench/src/test/java/io/netty/microbench/http2/NoopHttp2RemoteFlowController.java b/microbench/src/main/java/io/netty/microbench/http2/NoopHttp2RemoteFlowController.java similarity index 100% rename from microbench/src/test/java/io/netty/microbench/http2/NoopHttp2RemoteFlowController.java rename to microbench/src/main/java/io/netty/microbench/http2/NoopHttp2RemoteFlowController.java diff --git a/microbench/src/main/java/io/netty/microbench/http2/package-info.java b/microbench/src/main/java/io/netty/microbench/http2/package-info.java new file mode 100644 index 0000000000..510160f612 --- /dev/null +++ b/microbench/src/main/java/io/netty/microbench/http2/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2015 The Netty Project + * + * The Netty Project licenses this file to you 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. + */ +/** + * Benchmarks for {@link io.netty.handler.codec.http2}. + */ +package io.netty.microbench.http2; diff --git a/microbench/src/test/java/io/netty/microbench/internal/PlatformDependentBenchmark.java b/microbench/src/main/java/io/netty/microbench/internal/PlatformDependentBenchmark.java similarity index 100% rename from microbench/src/test/java/io/netty/microbench/internal/PlatformDependentBenchmark.java rename to microbench/src/main/java/io/netty/microbench/internal/PlatformDependentBenchmark.java diff --git a/microbench/src/test/java/io/netty/microbench/internal/RecyclableArrayListBenchmark.java b/microbench/src/main/java/io/netty/microbench/internal/RecyclableArrayListBenchmark.java similarity index 92% rename from microbench/src/test/java/io/netty/microbench/internal/RecyclableArrayListBenchmark.java rename to microbench/src/main/java/io/netty/microbench/internal/RecyclableArrayListBenchmark.java index b6be233c5d..dfb95a6796 100644 --- a/microbench/src/test/java/io/netty/microbench/internal/RecyclableArrayListBenchmark.java +++ b/microbench/src/main/java/io/netty/microbench/internal/RecyclableArrayListBenchmark.java @@ -20,11 +20,14 @@ import io.netty.util.internal.RecyclableArrayList; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Threads; /** * This class benchmarks different allocators with different allocation sizes. */ +@State(Scope.Benchmark) @Threads(4) @Measurement(iterations = 10, batchSize = 100) public class RecyclableArrayListBenchmark extends AbstractMicrobenchmark { diff --git a/microbench/src/main/java/io/netty/microbench/internal/package-info.java b/microbench/src/main/java/io/netty/microbench/internal/package-info.java new file mode 100644 index 0000000000..42b6dfc23b --- /dev/null +++ b/microbench/src/main/java/io/netty/microbench/internal/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2015 The Netty Project + * + * The Netty Project licenses this file to you 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. + */ +/** + * Benchmarks for {@link io.netty.util.internal}. + */ +package io.netty.microbench.internal; diff --git a/microbench/src/test/java/io/netty/microbench/util/AbstractMicrobenchmark.java b/microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmark.java similarity index 96% rename from microbench/src/test/java/io/netty/microbench/util/AbstractMicrobenchmark.java rename to microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmark.java index 9156702989..36816b16bc 100644 --- a/microbench/src/test/java/io/netty/microbench/util/AbstractMicrobenchmark.java +++ b/microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmark.java @@ -37,7 +37,7 @@ public class AbstractMicrobenchmark extends AbstractMicrobenchmarkBase { static { final String[] customArgs = { "-Xms768m", "-Xmx768m", "-XX:MaxDirectMemorySize=768m", "-Dharness.executor=CUSTOM", - "-Dharness.executor.class=io.netty.microbench.util.AbstractMicrobenchmark$HarnessExecutor" }; + "-Dharness.executor.class=AbstractMicrobenchmark$HarnessExecutor" }; JVM_ARGS = new String[BASE_JVM_ARGS.length + customArgs.length]; System.arraycopy(BASE_JVM_ARGS, 0, JVM_ARGS, 0, BASE_JVM_ARGS.length); diff --git a/microbench/src/test/java/io/netty/microbench/util/AbstractMicrobenchmarkBase.java b/microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmarkBase.java similarity index 100% rename from microbench/src/test/java/io/netty/microbench/util/AbstractMicrobenchmarkBase.java rename to microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmarkBase.java diff --git a/microbench/src/test/java/io/netty/microbench/util/AbstractSharedExecutorMicrobenchmark.java b/microbench/src/main/java/io/netty/microbench/util/AbstractSharedExecutorMicrobenchmark.java similarity index 97% rename from microbench/src/test/java/io/netty/microbench/util/AbstractSharedExecutorMicrobenchmark.java rename to microbench/src/main/java/io/netty/microbench/util/AbstractSharedExecutorMicrobenchmark.java index 13bad0fb3d..fd131682be 100644 --- a/microbench/src/test/java/io/netty/microbench/util/AbstractSharedExecutorMicrobenchmark.java +++ b/microbench/src/main/java/io/netty/microbench/util/AbstractSharedExecutorMicrobenchmark.java @@ -39,7 +39,7 @@ public class AbstractSharedExecutorMicrobenchmark extends AbstractMicrobenchmark static { final String[] customArgs = { "-Xms2g", "-Xmx2g", "-XX:MaxDirectMemorySize=2g", "-Dharness.executor=CUSTOM", - "-Dharness.executor.class=io.netty.microbench.util.AbstractSharedExecutorMicrobenchmark$DelegateHarnessExecutor" }; + "-Dharness.executor.class=AbstractSharedExecutorMicrobenchmark$DelegateHarnessExecutor" }; JVM_ARGS = new String[BASE_JVM_ARGS.length + customArgs.length]; System.arraycopy(BASE_JVM_ARGS, 0, JVM_ARGS, 0, BASE_JVM_ARGS.length); diff --git a/microbench/src/main/java/io/netty/microbench/util/package-info.java b/microbench/src/main/java/io/netty/microbench/util/package-info.java new file mode 100644 index 0000000000..dd3f343883 --- /dev/null +++ b/microbench/src/main/java/io/netty/microbench/util/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2015 The Netty Project + * + * The Netty Project licenses this file to you 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. + */ +/** + * Benchmarks for {@link io.netty.util}. + */ +package io.netty.microbench.util; diff --git a/microbench/src/test/java/io/netty/microbenchmark/common/IntObjectHashMapBenchmark.java b/microbench/src/main/java/io/netty/microbenchmark/common/IntObjectHashMapBenchmark.java similarity index 100% rename from microbench/src/test/java/io/netty/microbenchmark/common/IntObjectHashMapBenchmark.java rename to microbench/src/main/java/io/netty/microbenchmark/common/IntObjectHashMapBenchmark.java diff --git a/microbench/src/test/java/io/netty/microbenchmark/common/NetUtilBenchmark.java b/microbench/src/main/java/io/netty/microbenchmark/common/NetUtilBenchmark.java similarity index 100% rename from microbench/src/test/java/io/netty/microbenchmark/common/NetUtilBenchmark.java rename to microbench/src/main/java/io/netty/microbenchmark/common/NetUtilBenchmark.java diff --git a/microbench/src/main/java/io/netty/microbenchmark/common/package-info.java b/microbench/src/main/java/io/netty/microbenchmark/common/package-info.java new file mode 100644 index 0000000000..66d207e1d0 --- /dev/null +++ b/microbench/src/main/java/io/netty/microbenchmark/common/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2015 The Netty Project + * + * The Netty Project licenses this file to you 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. + */ +/** + * Benchmarks for {@link io.netty.util}. + */ +package io.netty.microbenchmark.common; diff --git a/microbench/src/test/resources/logback.xml b/microbench/src/main/resources/logback.xml similarity index 100% rename from microbench/src/test/resources/logback.xml rename to microbench/src/main/resources/logback.xml