Ios long acquisition request various stages of the network consumption

Recently because to do network detection, so I began to research how to get the contents of the request under iOS. For example, the first packet time, DNS resolution time, connect time request, SSL handshake time, download speed, upload speed and so on network indicators. If the data is iOS native method is substantially not obtained, iOS 10 can be acquired by the information system follows:

- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didFinishCollectingMetrics:(NSURLSessionTaskMetrics *)metrics API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));


Author: Auditore
link: https: //www.jianshu.com/p/f146f8fdadbf
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.
 
NSURLSession.h header on the note, the required data is stored in the NSURLSessionTaskMetrics NSURLSessionTaskTransactionMetrics subject

domainLookup DNS resolution is related to other related documents can be read

 

 

Simply view the command line

https://blog.csdn.net/xianyirenx/article/details/84890648

Guess you like

Origin www.cnblogs.com/yuxiaoyiyou/p/10951684.html