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

feat: Add PerformanceTests #1910

Merged
merged 11 commits into from
Mar 28, 2025
Merged

feat: Add PerformanceTests #1910

merged 11 commits into from
Mar 28, 2025

Conversation

dayaffe
Copy link
Contributor

@dayaffe dayaffe commented Mar 26, 2025

Issue #

SWIFT-2636

Description of changes

  • Add PerformanceTests to the SDK, starting with a latency test on STS. Execute using swift run
  • XCTest was considered but instead this is an executable for fine grained control over the output
  • Test results are printed to standard out

Example Output:

{
  "productId" : "AWS SDK for Swift",
  "commitId" : "597be9d3fc7286807fd7a75c2153f6374eb9ef0c",
  "results" : [
    {
      "date" : 1743017237,
      "name" : "sts.getcalleridentity.latency",
      "unit" : "Milliseconds",
      "description" : "The total time between initiating a GetCallerIdentity and reading the last byte of the object.",
      "dimensions" : [
        {
          "name" : "OS",
          "value" : "macOS"
        }
      ],
      "measurements" : [
        358.86406898498535,
        276.1859893798828,
        285.6259346008301,
        274.4629383087158,
        279.0100574493408
      ]
    }
  ],
  "sdkVersion" : "1.2.36"
}

New/existing dependencies impact assessment, if applicable

Conventional Commits

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@sichanyoo sichanyoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments mostly around naming & organization.

@dayaffe dayaffe requested a review from sichanyoo March 27, 2025 15:57
enum OperatingSystem: String {
case macOS = "macOS"
case Linux = "Linux"
case Unknown = "Unknown"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: cases of a Swift enum should start with lower case (macOS, linux, unknown)


/// Retrieves the SDK version from a file.
static func getSdkVersion() -> String {
return ProcessRunner.runProcess(arguments: ["cat", "../../aws-sdk-swift/Package.version"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do it elsewhere, but for safety maybe trim leading & trailing whitespace before returning version string


struct Dimension: Codable {
let name: String // The name of the dimension. MUST comply with CloudWatch constraints on dimension name.
let value: String // The value of the dimension. MUST comply with CloudWatch constraints on dimension value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These may as well be doc comments (three slashes on line before property) so that they show in tooltip help

Also, the same sort of comments are appropriate on PerformanceTestReport and PerformanceTestResult which also form the test report structure.

@dayaffe dayaffe requested a review from jbelkins March 28, 2025 15:49
@dayaffe dayaffe merged commit 2dbf482 into main Mar 28, 2025
25 checks passed
@dayaffe dayaffe deleted the day/roader-runner-onboard branch March 28, 2025 16:30
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.

3 participants