Sample Code

Collecting Network Connection Metrics

Use reports to understand how DNS and protocol handshakes impact connection establishment.



See Also

Collecting Connection Metrics

func requestEstablishmentReport(queue: DispatchQueue, completion: (NWConnection.EstablishmentReport?) -> Void)

Requests a copy of the connection's establishment report once the connection is in the ready state.

struct NWConnection.EstablishmentReport

A report that provides metrics about how a connection was established.

func startDataTransferReport() -> NWConnection.PendingDataTransferReport

Begins a new data transfer report, which can later be collected.

class NWConnection.PendingDataTransferReport

An outstanding data transfer report that has yet to be collected.

struct NWConnection.DataTransferReport

A report that provides metrics about data being sent and received on a connection.