Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@
import software.amazon.awssdk.benchmark.apicall.protocol.QueryProtocolBenchmark;
import software.amazon.awssdk.benchmark.apicall.protocol.SmithyRpcV2ProtocolBenchmark;
import software.amazon.awssdk.benchmark.apicall.protocol.XmlProtocolBenchmark;
import software.amazon.awssdk.benchmark.coldstart.V2ColdStartAfterWarmUpBenchmark;
import software.amazon.awssdk.benchmark.coldstart.V2ColdStartNoWarmUpBenchmark;
import software.amazon.awssdk.benchmark.coldstart.V2DefaultClientCreationBenchmark;
import software.amazon.awssdk.benchmark.coldstart.V2OptimizedClientCreationBenchmark;
import software.amazon.awssdk.benchmark.coldstart.V2SdkWarmUpExecutionTimeBenchmark;
import software.amazon.awssdk.benchmark.enhanced.dynamodb.EnhancedClientDeleteV1MapperComparisonBenchmark;
import software.amazon.awssdk.benchmark.enhanced.dynamodb.EnhancedClientGetOverheadBenchmark;
import software.amazon.awssdk.benchmark.enhanced.dynamodb.EnhancedClientGetV1MapperComparisonBenchmark;
Expand Down Expand Up @@ -87,7 +90,10 @@ public class BenchmarkRunner {

private static final List<String> COLD_START_BENCHMARKS = Arrays.asList(
V2OptimizedClientCreationBenchmark.class.getSimpleName(),
V2DefaultClientCreationBenchmark.class.getSimpleName());
V2DefaultClientCreationBenchmark.class.getSimpleName(),
V2ColdStartNoWarmUpBenchmark.class.getSimpleName(),
V2ColdStartAfterWarmUpBenchmark.class.getSimpleName(),
V2SdkWarmUpExecutionTimeBenchmark.class.getSimpleName());

private static final List<String> MAPPER_BENCHMARKS = Arrays.asList(
EnhancedClientGetOverheadBenchmark.class.getSimpleName(),
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
import software.amazon.awssdk.benchmark.utils.MockHttpServer;

/**
* V1 roundtrip benchmark for SmithyRpcV2 CBOR protocol using CloudWatch GetMetricData via HTTP servlet.
Expand All @@ -53,16 +54,14 @@
@OutputTimeUnit(TimeUnit.SECONDS)
public class V1CborRoundtripBenchmark {

private ProtocolRoundtripServer server;
private MockHttpServer server;
private AmazonCloudWatch client;

@Setup(Level.Trial)
public void setup() throws Exception {
byte[] response = createCborResponseFixture();

ProtocolRoundtripServlet servlet = new ProtocolRoundtripServlet(response, "application/cbor");

server = new ProtocolRoundtripServer(servlet);
server = new MockHttpServer(response, "application/cbor");
server.start();

client = AmazonCloudWatchClientBuilder.standard()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
import software.amazon.awssdk.benchmark.utils.MockHttpServer;

/**
* V1 roundtrip benchmark for EC2 protocol using EC2 DescribeInstances via HTTP servlet.
Expand All @@ -48,16 +49,14 @@
@OutputTimeUnit(TimeUnit.SECONDS)
public class V1Ec2RoundtripBenchmark {

private ProtocolRoundtripServer server;
private MockHttpServer server;
private AmazonEC2 client;

@Setup(Level.Trial)
public void setup() throws Exception {
byte[] response = ProtocolRoundtripServer.loadFixture("ec2-protocol/describe-instances-response.xml");
byte[] response = MockHttpServer.loadFixture("ec2-protocol/describe-instances-response.xml");

ProtocolRoundtripServlet servlet = new ProtocolRoundtripServlet(response, "text/xml");

server = new ProtocolRoundtripServer(servlet);
server = new MockHttpServer(response, "text/xml");
server.start();

client = AmazonEC2ClientBuilder.standard()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
import software.amazon.awssdk.benchmark.utils.MockHttpServer;

/**
* V1 roundtrip benchmark for JSON protocol (aws-json) using DynamoDB PutItem via HTTP servlet.
Expand All @@ -51,16 +52,14 @@
@OutputTimeUnit(TimeUnit.SECONDS)
public class V1JsonRoundtripBenchmark {

private ProtocolRoundtripServer server;
private MockHttpServer server;
private AmazonDynamoDB client;

@Setup(Level.Trial)
public void setup() throws Exception {
byte[] response = ProtocolRoundtripServer.loadFixture("json-protocol/putitem-response.json");
byte[] response = MockHttpServer.loadFixture("json-protocol/putitem-response.json");

ProtocolRoundtripServlet servlet = new ProtocolRoundtripServlet(response, "application/x-amz-json-1.0");

server = new ProtocolRoundtripServer(servlet);
server = new MockHttpServer(response, "application/x-amz-json-1.0");
server.start();

client = AmazonDynamoDBClientBuilder.standard()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
import software.amazon.awssdk.benchmark.utils.MockHttpServer;

/**
* V1 roundtrip benchmark for Query protocol using STS AssumeRole via HTTP servlet.
Expand All @@ -47,16 +48,14 @@
@OutputTimeUnit(TimeUnit.SECONDS)
public class V1QueryRoundtripBenchmark {

private ProtocolRoundtripServer server;
private MockHttpServer server;
private AWSSecurityTokenService client;

@Setup(Level.Trial)
public void setup() throws Exception {
byte[] response = ProtocolRoundtripServer.loadFixture("query-protocol/assumerole-response.xml");
byte[] response = MockHttpServer.loadFixture("query-protocol/assumerole-response.xml");

ProtocolRoundtripServlet servlet = new ProtocolRoundtripServlet(response, "text/xml");

server = new ProtocolRoundtripServer(servlet);
server = new MockHttpServer(response, "text/xml");
server.start();

client = AWSSecurityTokenServiceClientBuilder.standard()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
import software.amazon.awssdk.benchmark.utils.MockHttpServer;

/**
* V1 roundtrip benchmark for REST-JSON protocol using Lambda CreateFunction via HTTP servlet.
Expand All @@ -54,16 +55,14 @@
@OutputTimeUnit(TimeUnit.SECONDS)
public class V1RestJsonRoundtripBenchmark {

private ProtocolRoundtripServer server;
private MockHttpServer server;
private AWSLambda client;

@Setup(Level.Trial)
public void setup() throws Exception {
byte[] response = ProtocolRoundtripServer.loadFixture("rest-json-protocol/createfunction-response.json");
byte[] response = MockHttpServer.loadFixture("rest-json-protocol/createfunction-response.json");

ProtocolRoundtripServlet servlet = new ProtocolRoundtripServlet(response, "application/json");

server = new ProtocolRoundtripServer(servlet);
server = new MockHttpServer(response, "application/json");
server.start();

client = AWSLambdaClientBuilder.standard()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
import software.amazon.awssdk.benchmark.utils.MockHttpServer;

/**
* V1 roundtrip benchmark for REST-XML protocol using CloudFront CreateDistribution via HTTP servlet.
Expand All @@ -57,16 +58,14 @@
@OutputTimeUnit(TimeUnit.SECONDS)
public class V1RestXmlRoundtripBenchmark {

private ProtocolRoundtripServer server;
private MockHttpServer server;
private AmazonCloudFront client;

@Setup(Level.Trial)
public void setup() throws Exception {
byte[] response = ProtocolRoundtripServer.loadFixture("rest-xml-protocol/create-distribution-response.xml");
byte[] response = MockHttpServer.loadFixture("rest-xml-protocol/create-distribution-response.xml");

ProtocolRoundtripServlet servlet = new ProtocolRoundtripServlet(response, "text/xml");

server = new ProtocolRoundtripServer(servlet);
server = new MockHttpServer(response, "text/xml");
server.start();

client = AmazonCloudFrontClientBuilder.standard()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
import software.amazon.awssdk.benchmark.utils.MockHttpServer;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.http.apache5.Apache5HttpClient;
Expand All @@ -53,16 +54,14 @@
@OutputTimeUnit(TimeUnit.SECONDS)
public class V2CborRoundtripBenchmark {

private ProtocolRoundtripServer server;
private MockHttpServer server;
private CloudWatchClient client;

@Setup(Level.Trial)
public void setup() throws Exception {
byte[] response = createCborResponseFixture();

ProtocolRoundtripServlet servlet = new ProtocolRoundtripServlet(response, "application/cbor");

server = new ProtocolRoundtripServer(servlet);
server = new MockHttpServer(response, "application/cbor");
server.start();

client = CloudWatchClient.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
import software.amazon.awssdk.benchmark.utils.MockHttpServer;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.http.apache5.Apache5HttpClient;
Expand All @@ -48,16 +49,14 @@
@OutputTimeUnit(TimeUnit.SECONDS)
public class V2Ec2RoundtripBenchmark {

private ProtocolRoundtripServer server;
private MockHttpServer server;
private Ec2Client client;

@Setup(Level.Trial)
public void setup() throws Exception {
byte[] response = ProtocolRoundtripServer.loadFixture("ec2-protocol/describe-instances-response.xml");
byte[] response = MockHttpServer.loadFixture("ec2-protocol/describe-instances-response.xml");

ProtocolRoundtripServlet servlet = new ProtocolRoundtripServlet(response, "text/xml");

server = new ProtocolRoundtripServer(servlet);
server = new MockHttpServer(response, "text/xml");
server.start();

client = Ec2Client.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.openjdk.jmh.annotations.TearDown;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
import software.amazon.awssdk.benchmark.utils.MockHttpServer;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.core.SdkBytes;
Expand All @@ -51,16 +52,14 @@
@OutputTimeUnit(TimeUnit.SECONDS)
public class V2JsonRoundtripBenchmark {

private ProtocolRoundtripServer server;
private MockHttpServer server;
private DynamoDbClient client;

@Setup(Level.Trial)
public void setup() throws Exception {
byte[] response = ProtocolRoundtripServer.loadFixture("json-protocol/putitem-response.json");
byte[] response = MockHttpServer.loadFixture("json-protocol/putitem-response.json");

ProtocolRoundtripServlet servlet = new ProtocolRoundtripServlet(response, "application/x-amz-json-1.0");

server = new ProtocolRoundtripServer(servlet);
server = new MockHttpServer(response, "application/x-amz-json-1.0");
server.start();

client = DynamoDbClient.builder()
Expand Down
Loading
Loading