Skip to content

Commit

Permalink
style nit
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws committed Sep 18, 2024
1 parent 24e8315 commit 89db9ac
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ private GoWriter.Writable generateInvokeOperation() {
o.Properties.Set("rpc.method", opID)
o.Properties.Set("rpc.service", ServiceID)
})
defer startMetricTimer(ctx, "client.call.duration")()
endTimer := startMetricTimer(ctx, "client.call.duration")
defer endTimer()
defer span.End()
handler := $newClientHandler:T(options.HTTPClient)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ private void generateOperationDeserializerMiddleware(GenerationContext context,

writer.write(goTemplate("""
_, span := $T(ctx, "OperationDeserializer")
defer startMetricTimer(ctx, "client.call.deserialization_duration")()
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
defer endTimer()
defer span.End()
""", SMITHY_TRACING.func("StartSpan")));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ private void generateOperationDeserializer(GenerationContext context, OperationS

writer.write(goTemplate("""
_, span := $T(ctx, "OperationDeserializer")
defer startMetricTimer(ctx, "client.call.deserialization_duration")()
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
defer endTimer()
defer span.End()
""", SMITHY_TRACING.func("StartSpan")));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private GoWriter.Writable generateStruct() {
type operationMetrics struct {
Duration metrics.Float64Histogram
SerializeDuration metrics.Float64Histogram
GetIdentityDuration metrics.Float64Histogram
ResolveIdentityDuration metrics.Float64Histogram
ResolveEndpointDuration metrics.Float64Histogram
SignRequestDuration metrics.Float64Histogram
DeserializeDuration metrics.Float64Histogram
Expand Down Expand Up @@ -83,7 +83,7 @@ func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (con
if err != nil {
return nil, err
}
om.GetIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration",
om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration",
"The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider")
if err != nil {
return nil, err
Expand Down Expand Up @@ -129,7 +129,7 @@ private GoWriter.Writable generateHelpers() {
case "client.call.serialization_duration":
return m.SerializeDuration
case "client.call.resolve_identity_duration":
return m.GetIdentityDuration
return m.ResolveIdentityDuration
case "client.call.resolve_endpoint_duration":
return m.ResolveEndpointDuration
case "client.call.signing_duration":
Expand Down

0 comments on commit 89db9ac

Please sign in to comment.