Skip to content

Commit

Permalink
Fix MonitoringOptions (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 authored Mar 15, 2024
1 parent d0674a3 commit 459da1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions Source/AwsCommonRuntimeKit/http/HTTPMonitoringOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@
import AwsCHttp

public struct HTTPMonitoringOptions: CStruct {
/// Minimum amount of throughput, in bytes per second, for a connection to be considered healthy

/// Minimum amount of throughput, in bytes per second, for a connection to be considered healthy.
/// Must be at least one.
public var minThroughputBytesPerSecond: UInt64

/// How long, in seconds, a connection is allowed to be unhealthy before getting shut down.
/// Must be at least two
/// Must be at least one.
public var allowableThroughputFailureInterval: UInt32

init(minThroughputBytesPerSecond: UInt64 = 0,
allowableThroughputFailureInterval: UInt32 = 2) {
public init(
minThroughputBytesPerSecond: UInt64,
allowableThroughputFailureInterval: UInt32
) {
self.minThroughputBytesPerSecond = minThroughputBytesPerSecond
self.allowableThroughputFailureInterval = allowableThroughputFailureInterval
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class HTTPClientConnectionOptionsTests: XCBaseTestCase {
proxyEnvSettings: HTTPProxyEnvSettings(envVarType: HTTPProxyEnvType.disable),
socketOptions: SocketOptions(socketType: .stream),
tlsOptions: tlsOptions,
monitoringOptions: HTTPMonitoringOptions(minThroughputBytesPerSecond: 10),
monitoringOptions: HTTPMonitoringOptions(minThroughputBytesPerSecond: 10, allowableThroughputFailureInterval: 3),
maxConnections: 10,
enableManualWindowManagement: true,
maxConnectionIdleMs: 100,
Expand Down

0 comments on commit 459da1e

Please sign in to comment.