An object encapsulating the metrics for a session task.


class URLSessionTaskMetrics : NSObject


Each URLSessionTaskMetrics object contains the taskInterval and redirectCount, as well as metrics for each request-and-response transaction made during the execution of the task.


Creating Task Metrics


Creates a task metrics instance.

Accessing Task Metrics

var transactionMetrics: [URLSessionTaskTransactionMetrics]

An array of metrics for each individual request-response transaction made during the execution of the task.

class URLSessionTaskTransactionMetrics

An object encapsulating the performance metrics collected during the execution of a session task.

var taskInterval: DateInterval

The time interval between when a task is instantiated and when the task is completed.

var redirectCount: Int

The number of redirects that occurred during the execution of the task.


Inherits From

Conforms To

See Also

Collecting Task Metrics

func urlSession(URLSession, task: URLSessionTask, didFinishCollecting: URLSessionTaskMetrics)

Tells the delegate that the session finished collecting metrics for the task.