|
20 | 20 | import java.io.IOException;
|
21 | 21 | import java.io.InputStream;
|
22 | 22 | import java.io.UncheckedIOException;
|
| 23 | +import java.net.URI; |
23 | 24 | import java.util.Map;
|
| 25 | +import java.util.concurrent.TimeUnit; |
24 | 26 | import org.openjdk.jmh.annotations.Benchmark;
|
| 27 | +import org.openjdk.jmh.annotations.BenchmarkMode; |
| 28 | +import org.openjdk.jmh.annotations.Fork; |
| 29 | +import org.openjdk.jmh.annotations.Mode; |
| 30 | +import org.openjdk.jmh.annotations.OutputTimeUnit; |
25 | 31 | import org.openjdk.jmh.annotations.Param;
|
26 | 32 | import org.openjdk.jmh.annotations.Scope;
|
27 | 33 | import org.openjdk.jmh.annotations.Setup;
|
28 | 34 | import org.openjdk.jmh.annotations.State;
|
| 35 | +import software.amazon.awssdk.core.client.config.SdkClientConfiguration; |
| 36 | +import software.amazon.awssdk.core.client.config.SdkClientOption; |
29 | 37 | import software.amazon.awssdk.core.http.HttpResponseHandler;
|
30 | 38 | import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
|
31 | 39 | import software.amazon.awssdk.http.AbortableInputStream;
|
|
61 | 69 | import software.amazon.awssdk.services.dynamodb.model.TableNotFoundException;
|
62 | 70 | import software.amazon.awssdk.services.dynamodb.transform.PutItemRequestMarshaller;
|
63 | 71 |
|
64 |
| - |
| 72 | +@BenchmarkMode(Mode.AverageTime) |
| 73 | +@OutputTimeUnit(TimeUnit.NANOSECONDS) |
| 74 | +@Fork(1) |
65 | 75 | public class V2DynamoDbAttributeValue {
|
66 | 76 |
|
67 | 77 | private static final AwsJsonProtocolFactory JSON_PROTOCOL_FACTORY = AwsJsonProtocolFactory
|
68 | 78 | .builder()
|
| 79 | + .clientConfiguration(SdkClientConfiguration |
| 80 | + .builder() |
| 81 | + .option(SdkClientOption.ENDPOINT, URI.create("https://localhost")) |
| 82 | + .build()) |
69 | 83 | .defaultServiceExceptionSupplier(DynamoDbException::builder)
|
70 | 84 | .protocol(AwsJsonProtocol.AWS_JSON)
|
71 | 85 | .protocolVersion("1.0")
|
|
0 commit comments