Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ struct PerformanceMain {
let sdkVersion = ProcessRunner.getSdkVersion()

// Add more tests here
let performanceTests = [
AWSSTSGetCallerIdentity()
let performanceTests: [PerformanceTest] = [
AWSSTSGetCallerIdentity(),
AWSSTSGetCallerIdentityNIO()
]

var results: [PerformanceTestResult] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import AWSSTS
import Foundation
import ClientRuntime

struct AWSSTSGetCallerIdentity: PerformanceTest {
let name = "sts.getcalleridentity.latency"
Expand All @@ -28,3 +29,26 @@ struct AWSSTSGetCallerIdentity: PerformanceTest {
return Date().timeIntervalSince(start) * 1000 // Convert seconds to milliseconds
}
}

struct AWSSTSGetCallerIdentityNIO: PerformanceTest {
let name = "sts.getcalleridentity.nio.latency"

let description = "The total time between initiating a GetCallerIdentity and reading the last byte of the object using NIO HTTP Client."

let unit = Unit.milliseconds

let dimensions = [
Dimension(name: "OS", value: OperatingSystem.current.rawValue),
]

let test = getCallerIdentityNIO

static func getCallerIdentityNIO() async throws -> Double {
let start = Date()
let nioClient = NIOHTTPClient(httpClientConfiguration: HttpClientConfiguration())
let config = try await STSClient.STSClientConfiguration(region: "us-west-2", httpClientEngine: nioClient)
let client = STSClient(config: config)
_ = try await client.getCallerIdentity(input: .init())
return Date().timeIntervalSince(start) * 1000 // Convert seconds to milliseconds
}
}
Loading