Unverified Commit a737694f authored by Harry Barber's avatar Harry Barber Committed by GitHub
Browse files

Move examples to root, refactor to workspace, and refactor integration tests (#2481)



* Move examples

* Update documentation

* Add to CI

* Fix CI

* Cleanup

* Fix clippy lints

* Fix documentation

* Bump example dependencies

* Cleanup

* Update documentation

---------

Co-authored-by: default avatarMatteo Bigoi <1781140+crisidev@users.noreply.github.com>
parent f3e44742
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ Project Layout
* [`design`](design): Design documentation. See the [design/README.md](design/README.md) for details about building / viewing.
* `codegen-server`: Whitelabel Smithy server code generation
* `codegen-server-test`: Smithy protocol test generation & integration tests for Smithy server whitelabel code
* `examples`: A collection of server implementation examples

Testing
-------
+1 −1
Original line number Diff line number Diff line
@@ -648,7 +648,7 @@ stateDiagram-v2
    Op1 --> Op2 : Plugin#colon;#colon;map
```

An example `Plugin` implementation can be found in [aws-smithy-http-server/examples/pokemon-service/src/plugin.rs](https://github.com/awslabs/smithy-rs/blob/main/rust-runtime/aws-smithy-http-server/examples/pokemon-service/src/plugin.rs).
An example `Plugin` implementation can be found in [/examples/pokemon-service/src/plugin.rs](https://github.com/awslabs/smithy-rs/blob/main/examples/pokemon-service/src/plugin.rs).

The service builder API requires plugins to be specified upfront - they must be passed as an argument to `builder_with_plugins` and cannot be modified afterwards.
This constraint is in place to ensure that all handlers are upgraded using the same set of plugins.
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ let app = PokemonService::builder_with_plugins(plugins)

### Example

The Pokémon service example, located at `rust-runtime/aws-smithy-http-server/examples/pokemon-service`, sets up a `tracing` `Subscriber` as follows:
The Pokémon service example, located at `/examples/pokemon-service`, sets up a `tracing` `Subscriber` as follows:

```rust
/// Setup `tracing::subscriber` to read the log level from RUST_LOG environment variable.
+1 −0
Original line number Diff line number Diff line
pokemon-service-client/
pokemon-service-server-sdk/
Cargo.lock
+26 −25
Original line number Diff line number Diff line
@@ -5,11 +5,12 @@ using [wrk](https://github.com/wg/wrk).

<!-- vim-markdown-toc Marked -->

* [2022-03-04](#2022-03-04)
    * [c6i.8xlarge](#c6i.8xlarge)
        * [Full result](#full-result)
    * [c6g.8xlarge](#c6g.8xlarge)
        * [Full result](#full-result)
- [Smithy Rust Server SDK benchmarks](#smithy-rust-server-sdk-benchmarks)
  - [2022-03-04](#2022-03-04)
    - [c6i.8xlarge](#c6i8xlarge)
      - [Full result](#full-result)
    - [c6g.8xlarge](#c6g8xlarge)
      - [Full result](#full-result-1)

<!-- vim-markdown-toc -->

@@ -20,19 +21,19 @@ returning an empty output and can be used to stress test the framework overhead.

### c6i.8xlarge

* 32 cores Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz
* 64 Gb memory
* Benchmark:
- 32 cores Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz
- 64 Gb memory
- Benchmark:
  - Duration: 10 minutes
  - Connections: 1024
  - Threads: 16
* Result:
- Result:
  - Request/sec: 1_608_742
    * RSS[^1] memory: 72200 bytes
  - RSS[^1] memory: 72200 bytes

#### Full result

```
```text
❯❯❯ wrk -t16 -c1024 -d10m --latency http://localhost:13734/empty-operation
Running 10m test @ http://localhost:13734/empty-operation
  16 threads and 1024 connections
@@ -52,20 +53,20 @@ Transfer/sec: 167.23MB

### c6g.8xlarge

* 32 cores Amazon Graviton 2 @ 2.50GHz
* 64 Gb memory
* Benchmark:
- 32 cores Amazon Graviton 2 @ 2.50GHz
- 64 Gb memory
- Benchmark:
  - Duration: 10 minutes
  - Connections: 1024
  - Threads: 16
* Result:
- Result:
  - Request/sec: 1_379_942
  - RSS[^1] memory: 70264 bytes


#### Full result

```
```text
❯❯❯ wrk -t16 -c1024 -d10m --latency http://localhost:13734/empty-operation
Running 10m test @ http://localhost:13734/empty-operation
  16 threads and 1024 connections
Loading