Skip to content

Commit 1c68b2b

Browse files
committed
Merge from main
1 parent dd47491 commit 1c68b2b

File tree

5 files changed

+6
-55
lines changed

5 files changed

+6
-55
lines changed

aws-runtime/aws-http/api/aws-http.api

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,6 @@ public final class aws/sdk/kotlin/runtime/http/interceptors/AddUserAgentMetadata
140140
public fun readBeforeTransmit (Laws/smithy/kotlin/runtime/client/ProtocolRequestInterceptorContext;)V
141141
}
142142

143-
public final class aws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric : java/lang/Enum, aws/smithy/kotlin/runtime/businessmetrics/BusinessMetric {
144-
public static final field DDB_MAPPER Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
145-
public static final field S3_EXPRESS_BUCKET Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
146-
public static fun getEntries ()Lkotlin/enums/EnumEntries;
147-
public fun getIdentifier ()Ljava/lang/String;
148-
public static fun valueOf (Ljava/lang/String;)Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
149-
public static fun values ()[Laws/sdk/kotlin/runtime/http/interceptors/AwsBusinessMetric;
150-
}
151-
152143
public final class aws/sdk/kotlin/runtime/http/interceptors/AwsSpanInterceptor : aws/smithy/kotlin/runtime/client/Interceptor {
153144
public static final field INSTANCE Laws/sdk/kotlin/runtime/http/interceptors/AwsSpanInterceptor;
154145
public fun modifyBeforeAttemptCompletion-gIAlu-s (Laws/smithy/kotlin/runtime/client/ResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
@@ -172,7 +163,7 @@ public final class aws/sdk/kotlin/runtime/http/interceptors/AwsSpanInterceptor :
172163
public fun readBeforeTransmit (Laws/smithy/kotlin/runtime/client/ProtocolRequestInterceptorContext;)V
173164
}
174165

175-
public final class aws/sdk/kotlin/runtime/http/interceptors/BusinessMetricsInterceptor : aws/smithy/kotlin/runtime/client/Interceptor {
166+
public final class aws/sdk/kotlin/runtime/http/interceptors/UnsupportedSigningAlgorithmInterceptor : aws/smithy/kotlin/runtime/client/Interceptor {
176167
public fun <init> ()V
177168
public fun modifyBeforeAttemptCompletion-gIAlu-s (Laws/smithy/kotlin/runtime/client/ResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
178169
public fun modifyBeforeCompletion-gIAlu-s (Laws/smithy/kotlin/runtime/client/ResponseInterceptorContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
@@ -196,6 +187,7 @@ public final class aws/sdk/kotlin/runtime/http/interceptors/BusinessMetricsInter
196187
}
197188

198189
public final class aws/sdk/kotlin/runtime/http/interceptors/businessmetrics/AwsBusinessMetric : java/lang/Enum, aws/smithy/kotlin/runtime/businessmetrics/BusinessMetric {
190+
public static final field DDB_MAPPER Laws/sdk/kotlin/runtime/http/interceptors/businessmetrics/AwsBusinessMetric;
199191
public static final field S3_EXPRESS_BUCKET Laws/sdk/kotlin/runtime/http/interceptors/businessmetrics/AwsBusinessMetric;
200192
public static fun getEntries ()Lkotlin/enums/EnumEntries;
201193
public fun getIdentifier ()Ljava/lang/String;

aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/interceptors/businessmetrics/AwsBusinessMetricsUtils.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ internal fun formatMetrics(metrics: MutableSet<BusinessMetric>): String {
4141
@InternalApi
4242
public enum class AwsBusinessMetric(public override val identifier: String) : BusinessMetric {
4343
S3_EXPRESS_BUCKET("J"),
44+
DDB_MAPPER("d"),
4445
;
4546

4647
@InternalApi

aws-runtime/aws-http/common/src/aws/sdk/kotlin/runtime/http/interceptors/businessmetrics/BusinessMetricsInterceptor.kt

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5-
package aws.sdk.kotlin.runtime.http.interceptors
5+
package aws.sdk.kotlin.runtime.http.interceptors.businessmetrics
66

7-
import aws.sdk.kotlin.runtime.http.BUSINESS_METRICS_MAX_LENGTH
87
import aws.sdk.kotlin.runtime.http.middleware.USER_AGENT
9-
import aws.smithy.kotlin.runtime.InternalApi
10-
import aws.smithy.kotlin.runtime.businessmetrics.BusinessMetric
118
import aws.smithy.kotlin.runtime.businessmetrics.BusinessMetrics
129
import aws.smithy.kotlin.runtime.client.ProtocolRequestInterceptorContext
1310
import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
@@ -30,39 +27,4 @@ public class BusinessMetricsInterceptor : HttpInterceptor {
3027
}
3128
return context.protocolRequest
3229
}
33-
}
34-
35-
/**
36-
* Makes sure the metrics do not exceed the maximum size and truncates them if so.
37-
*/
38-
private fun formatMetrics(metrics: MutableSet<BusinessMetric>): String {
39-
if (metrics.isEmpty()) return ""
40-
val metricsString = metrics.joinToString(",", "m/") { it.identifier }
41-
val metricsByteArray = metricsString.encodeToByteArray()
42-
43-
if (metricsByteArray.size <= BUSINESS_METRICS_MAX_LENGTH) return metricsString
44-
45-
val lastCommaIndex = metricsByteArray
46-
.sliceArray(0 until 1024)
47-
.indexOfLast { it == ','.code.toByte() }
48-
.takeIf { it != -1 }
49-
50-
lastCommaIndex?.let {
51-
return metricsByteArray.decodeToString(
52-
0,
53-
lastCommaIndex,
54-
true,
55-
)
56-
}
57-
58-
throw IllegalStateException("Business metrics are incorrectly formatted: $metricsString")
59-
}
60-
61-
/**
62-
* AWS SDK specific business metrics
63-
*/
64-
@InternalApi
65-
public enum class AwsBusinessMetric(public override val identifier: String) : BusinessMetric {
66-
S3_EXPRESS_BUCKET("J"),
67-
DDB_MAPPER("d"),
68-
}
30+
}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5-
package aws.sdk.kotlin.runtime.http.interceptors
5+
package aws.sdk.kotlin.runtime.http.interceptors.businessmetrics
66

77
import aws.sdk.kotlin.runtime.http.BUSINESS_METRICS_MAX_LENGTH
8-
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.AwsBusinessMetric
9-
import aws.sdk.kotlin.runtime.http.interceptors.businessmetrics.BusinessMetricsInterceptor
108
import aws.sdk.kotlin.runtime.http.middleware.USER_AGENT
119
import aws.smithy.kotlin.runtime.businessmetrics.BusinessMetric
1210
import aws.smithy.kotlin.runtime.businessmetrics.SmithyBusinessMetric

codegen/aws-sdk-codegen/src/main/resources/META-INF/services/software.amazon.smithy.kotlin.codegen.integration.KotlinIntegration

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ aws.sdk.kotlin.codegen.customization.cloudfrontkeyvaluestore.BackfillSigV4ACusto
4141
aws.sdk.kotlin.codegen.customization.s3.express.SigV4S3ExpressAuthSchemeIntegration
4242
aws.sdk.kotlin.codegen.customization.s3.express.S3ExpressIntegration
4343
aws.sdk.kotlin.codegen.customization.s3.S3ExpiresIntegration
44-
aws.sdk.kotlin.codegen.BusinessMetricsIntegration
4544
# aws.sdk.kotlin.codegen.smoketests.AwsSmokeTestsRunnerGeneratorIntegration
4645
# aws.sdk.kotlin.codegen.smoketests.testing.SmokeTestSuccessHttpEngineIntegration
4746
# aws.sdk.kotlin.codegen.smoketests.testing.SmokeTestFailHttpEngineIntegration
4847
aws.sdk.kotlin.codegen.customization.AwsQueryModeCustomization
4948
aws.sdk.kotlin.codegen.businessmetrics.BusinessMetricsInterceptorIntegration
5049
aws.sdk.kotlin.codegen.businessmetrics.CredentialsBusinessMetricsIntegration
5150
aws.sdk.kotlin.codegen.businessmetrics.EndpointBusinessMetricsIntegration
52-
aws.sdk.kotlin.codegen.smoketests.SmokeTestsDenyListIntegration

0 commit comments

Comments
 (0)