Skip to content

Commit

Permalink
Add some missing Javadoc comments (line#2197)
Browse files Browse the repository at this point in the history
- Add Javadocs for almost all methods in the benchmarks module
- Remove two emtpy lines in javadoc comments
  • Loading branch information
Stupremee authored and trustin committed Nov 8, 2019
1 parent d6a75ea commit 03a50fd
Showing 13 changed files with 42 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -37,6 +37,9 @@
import io.netty.channel.DefaultEventLoop;
import io.netty.channel.EventLoop;

/**
* Microbenchmarks of {@link StreamMessage Stream Messages}.
*/
@Fork(jvmArgsAppend = { EventLoopJmhExecutor.JVM_ARG_1, EventLoopJmhExecutor.JVM_ARG_2 })
@State(Scope.Benchmark)
public class StreamMessageBenchmark {
@@ -51,9 +54,9 @@ public void closeEventLoops() {
}

@State(Scope.Thread)
public static class StreamObjects {
private static class StreamObjects {

public enum StreamType {
private enum StreamType {
DEFAULT_STREAM_MESSAGE,
FIXED_STREAM_MESSAGE,
DEFERRED_FIXED_STREAM_MESSAGE,
Original file line number Diff line number Diff line change
@@ -36,11 +36,14 @@
import com.linecorp.armeria.server.ServerPort;
import com.linecorp.armeria.shared.AsyncCounters;

/**
* Microbenchmarks of a {@link Server}.
*/
@State(Scope.Benchmark)
public class HttpServerBenchmark {

// JMH bug prevents it from using enums that override toString() (it should use name() instead...).
public enum Protocol {
private enum Protocol {
H2C(SessionProtocol.H2C),
H1C(SessionProtocol.H1C);

Original file line number Diff line number Diff line change
@@ -30,6 +30,9 @@
import com.linecorp.armeria.common.HttpStatus;
import com.linecorp.armeria.server.Server;

/**
* Microbenchmarks of a {@link com.linecorp.armeria.client.endpoint.dns.DnsAddressEndpointGroup}.
*/
@State(Scope.Thread)
public class DnsEndpointGroupBenchmark {

Original file line number Diff line number Diff line change
@@ -31,6 +31,9 @@
import com.linecorp.armeria.client.endpoint.EndpointSelector;
import com.linecorp.armeria.client.endpoint.StaticEndpointGroup;

/**
* Microbenchmarks of different {@link EndpointSelector} configurations.
*/
@State(Scope.Thread)
public class WeightedRoundRobinStrategyBenchmark {

Original file line number Diff line number Diff line change
@@ -23,6 +23,9 @@

import com.linecorp.armeria.client.retry.Backoff;

/**
* Microbenchmarks of an {@link Backoff#exponential(long, long, double) expontational backoff}.
*/
@State(Scope.Benchmark)
public class BackoffBenchmark {

Original file line number Diff line number Diff line change
@@ -27,6 +27,9 @@
import com.linecorp.armeria.server.Server;
import com.linecorp.armeria.server.ServerPort;

/**
* The base for {@link WithDuplicator} and {@link WithoutDuplicator} microbenchmarks.
*/
@State(Scope.Benchmark)
public abstract class RetryingHttpClientBase {

Original file line number Diff line number Diff line change
@@ -16,6 +16,9 @@

package com.linecorp.armeria.grpc.shared;

/**
* Represents the different grpc client types.
*/
public enum ClientType {
// The official client for the benchmark (armeria for downstream, grpc-netty for upstream).
NORMAL,
Original file line number Diff line number Diff line change
@@ -26,6 +26,9 @@

import io.grpc.stub.StreamObserver;

/**
* The {@link GithubApiService} mocks the GitHub API by always sending the same response.
*/
public class GithubApiService extends GithubServiceImplBase {

public static final SearchResponse SEARCH_RESPONSE;
Original file line number Diff line number Diff line change
@@ -43,6 +43,9 @@
import io.grpc.ManagedChannel;
import io.grpc.okhttp.OkHttpChannelBuilder;

/**
* The {@link SimpleBenchmarkBase} contains the shared logic for benchmarking grpc.
*/
@State(Scope.Benchmark)
public abstract class SimpleBenchmarkBase {

Original file line number Diff line number Diff line change
@@ -24,6 +24,9 @@
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.infra.Blackhole;

/**
* Microbenchmarks for the {@link PathAndQuery#parse(String)} method.
*/
@State(Scope.Thread)
public class PathParsingBenchmark {

Original file line number Diff line number Diff line change
@@ -26,6 +26,9 @@
import com.linecorp.armeria.server.Server;
import com.linecorp.armeria.server.ServerPort;

/**
* The {@link SimpleBenchmarkBase} contains the shared logic for benchmarking retrofit2.
*/
@State(Scope.Benchmark)
public abstract class SimpleBenchmarkBase {

Original file line number Diff line number Diff line change
@@ -20,6 +20,9 @@

import retrofit2.http.GET;

/**
* Represents a basic client which is used for the retrofit2 benchmarks.
*/
public interface SimpleBenchmarkClient {
@GET("/empty")
CompletableFuture<String> empty();
6 changes: 3 additions & 3 deletions settings/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -191,9 +191,9 @@
<property name="allowUndeclaredRTE" value="true"/>
<property name="suppressLoadErrors" value="true"/>
</module>
<module name="MissingJavadocMethod">
<property name="minLineCount" value="1"/>
</module>
<!--<module name="MissingJavadocMethod"/>
<module name="MissingJavadocPackage"/>
<module name="MissingJavadocType"/>-->
<module name="JavadocParagraph"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="NonEmptyAtclauseDescription"/>

0 comments on commit 03a50fd

Please sign in to comment.