Swift Rest SDK Documentation Beta

Class Mobiledge​XiOSLibrary.​Performance​Metrics.​Net​Test

@available(iOS 13.0, *) public class NetTest

Class that allows developers to easily test latency of their various backend servers. This is used in the implementation of FindCloudlet Performance Mode.

Member Of

MobiledgeXiOSLibrary.PerformanceMetrics

Namespace for collecting network performance. Contains NetTest and Site classes

Nested Types

MobiledgeXiOSLibrary.PerformanceMetrics.NetTest.TestType

TestType is either PING or CONNECT, where PING is ICMP Ping (not implemented) and CONNECT is is actually setting up a connection and then disconnecting immediately.

Initializers

init(sites:​qos:​)

public init(sites: [Site], qos: DispatchQoS)

Properties

sites

var sites: [Site]

tests

var tests: [AnyCancellable]

timeout

var timeout = 5.0

Methods

run​Test(interval:​)

public func runTest(interval: Int)

Run tests at interval (milliseconds) indefinitely until call to cancelTest

run​Test(num​Samples:​)

public func runTest(numSamples: Int? = nil) -> Promise<[Site]>

Run NetTest for numSamples per site

return​Sorted​Sites()

public func returnSortedSites() -> [Site]

Sorted list of Sites from best to worst

cancel​Test()

public func cancelTest()

add​Site(site:​)

public func addSite(site: Site)

remove​Site(site:​)

public func removeSite(site: Site)

connect​And​Disconnect(site:​)

public func connectAndDisconnect(site: Site)

connect​And​Disconnect​Socket(site:​)

public func connectAndDisconnectSocket(site: Site)

Allows bind to cellular interface