Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly generate http response codes #1405

Merged
merged 5 commits into from
May 27, 2022
Merged

Correctly generate http response codes #1405

merged 5 commits into from
May 27, 2022

Conversation

82marbag
Copy link
Contributor

@82marbag 82marbag commented May 24, 2022

http response codes will be:

  • @httpResponseCode if set
  • @http's code, if @httpResponseCode is not set
  • the default one, if neither of the above are set

@httpResponseCode honors @required and generates code that
doesn't use Option when applied.

Closes: #1229

Motivation and Context

Description

  • set http response status to using Option only when not @required
  • default to @http's code when the status is not set
  • default to the builder's default if none is set
  • add tests

Testing

./gradlew :codegen-server-test:test && ./gradlew :codegen-test:test

Checklist

  • I have updated CHANGELOG.next.toml if I made changes to the smithy-rs codegen or runtime crates
  • I have updated CHANGELOG.next.toml if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@82marbag 82marbag requested review from a team as code owners May 24, 2022 10:30
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Rust Wrk benchmark report:

Duration: 90 sec, Connections: 32, Threads: 2

Measurement Deviation Current Old
Requests/sec -0.75% 39184.97 39482.42
Total requests -0.77% 3527659 3554925
Total errors NaN% 0 0
Total successes -0.77% 3527659 3554925
Average latency ms 1.19% 0.85 0.84
Minimum latency ms 0.00% 0.02 0.02
Maximum latency ms -6.96% 16.71 17.96
Stdev latency ms 11.32% 0.59 0.53
Transfer Mb -0.77% 366.7 369.54
Connect errors NaN% 0 0
Read errors NaN% 0 0
Write errors NaN% 0 0
Status errors (not 2xx/3xx) NaN% 0 0
Timeout errors NaN% 0 0

Daniele Ahmed added 2 commits May 24, 2022 13:42
http response codes will be:
* @http's code, if @httpResponseCode is not set
* the default one, if neither of the above are set

@httpResponseCode honors @required and generates code that
doesn't use Option when applied.

Closes: #1229

Signed-off-by: Daniele Ahmed <[email protected]>
Signed-off-by: Daniele Ahmed <[email protected]>
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Rust Wrk benchmark report:

Duration: 90 sec, Connections: 32, Threads: 2

Measurement Deviation Current Old
Requests/sec 10.28% 80850.82 73311.07
Total requests 10.30% 7280188 6600478
Total errors NaN% 0 0
Total successes 10.30% 7280188 6600478
Average latency ms 114.81% 1.16 0.54
Minimum latency ms 0.00% 0.02 0.02
Maximum latency ms 38.95% 23.65 17.02
Stdev latency ms 142.68% 1.99 0.82
Transfer Mb 10.30% 756.78 686.12
Connect errors NaN% 0 0
Read errors NaN% 0 0
Write errors NaN% 0 0
Status errors (not 2xx/3xx) NaN% 0 0
Timeout errors NaN% 0 0

Daniele Ahmed added 2 commits May 26, 2022 10:47
Signed-off-by: Daniele Ahmed <[email protected]>
Signed-off-by: Daniele Ahmed <[email protected]>
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Rust Wrk benchmark report:

Duration: 90 sec, Connections: 32, Threads: 2

Measurement Deviation Current Old
Requests/sec -2.52% 69881.78 71685.08
Total requests -2.59% 6289900 6457457
Total errors NaN% 0 0
Total successes -2.59% 6289900 6457457
Average latency ms 1.75% 0.58 0.57
Minimum latency ms 0.00% 0.02 0.02
Maximum latency ms -4.63% 16.47 17.27
Stdev latency ms -5.13% 0.74 0.78
Transfer Mb -2.60% 653.84 671.26
Connect errors NaN% 0 0
Read errors NaN% 0 0
Write errors NaN% 0 0
Status errors (not 2xx/3xx) NaN% 0 0
Timeout errors NaN% 0 0

@82marbag 82marbag enabled auto-merge (squash) May 27, 2022 08:46
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Rust Wrk benchmark report:

Duration: 90 sec, Connections: 32, Threads: 2

Measurement Deviation Current Old
Requests/sec -4.60% 70583.15 73986.16
Total requests -4.64% 6355069 6664497
Total errors NaN% 0 0
Total successes -4.64% 6355069 6664497
Average latency ms -21.25% 0.63 0.8
Minimum latency ms 0.00% 0.02 0.02
Maximum latency ms -14.94% 17.36 20.41
Stdev latency ms -32.03% 0.87 1.28
Transfer Mb -4.64% 660.61 692.78
Connect errors NaN% 0 0
Read errors NaN% 0 0
Write errors NaN% 0 0
Status errors (not 2xx/3xx) NaN% 0 0
Timeout errors NaN% 0 0

@82marbag 82marbag merged commit 1f31eae into main May 27, 2022
@82marbag 82marbag deleted the 1229 branch May 27, 2022 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problems with rendering of httpResponseCode binding
3 participants