API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0))
@interface NSURLSessionTaskTransactionMetrics : NSObject
// URLRequest 请求的Body和Header都在这里面呢,包含请求的全部信息。
@property (copy, readonly) NSURLRequest *request;
// URLResponse 相应的信息都在这个对象里面
@property (nullable, copy, readonly) NSURLResponse *response;
// 请求任务开始前,可以理解为整个请求的最开始的时间点。
@property (nullable, copy, readonly) NSDate *fetchStartDate;
// 开始DNS解析的时间点
@property (nullable, copy, readonly) NSDate *domainLookupStartDate;
// 结束DNS解析的时间点
@property (nullable, copy, readonly) NSDate *domainLookupEndDate;
// 建立连接的起始点
@property (nullable, copy, readonly) NSDate *connectStartDate;
// 建立 SSL/TLS 对话密钥的起始时间
@property (nullable, copy, readonly) NSDate *secureConnectionStartDate;
// 建立 SSL/TLS 对话密钥的终点时间
@property (nullable, copy, readonly) NSDate *secureConnectionEndDate;
// 建立连接的终点
@property (nullable, copy, readonly) NSDate *connectEndDate;
// 建立好连接通道后,请求开始的时间点
@property (nullable, copy, readonly) NSDate *requestStartDate;
// 建立好连接通道后,请求结束的时间点
@property (nullable, copy, readonly) NSDate *requestEndDate;
// 开始得到响应的时间点
@property (nullable, copy, readonly) NSDate *responseStartDate;
// 接收完最后一字节的数据的响应结束时间点
@property (nullable, copy, readonly) NSDate *responseEndDate;
// 网络协议的名称
@property (nullable, copy, readonly) NSString *networkProtocolName;
// 是否使用了网络代理
@property (assign, readonly, getter=isProxyConnection) BOOL proxyConnection;
// 是否重用了连接
@property (assign, readonly, getter=isReusedConnection) BOOL reusedConnection;
// 资源获取的类型,有缓存,Network,不知道,等
@property (assign, readonly) NSURLSessionTaskMetricsResourceFetchType resourceFetchType;
// iOS13+ 发送的请求头占的字节
@property (readonly) int64_t countOfRequestHeaderBytesSent API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 发送的Body占的字节
@property (readonly) int64_t countOfRequestBodyBytesSent API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 发送的Body在Encoding之前占的字节
@property (readonly) int64_t countOfRequestBodyBytesBeforeEncoding API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 响应头占字节数
@property (readonly) int64_t countOfResponseHeaderBytesReceived API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 响应Body体占字节数
@property (readonly) int64_t countOfResponseBodyBytesReceived API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ Decoding之后响应消息体占字节数
@property (readonly) int64_t countOfResponseBodyBytesAfterDecoding API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 本地IP地址
@property (nullable, copy, readonly) NSString *localAddress API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 本地端口
@property (nullable, copy, readonly) NSNumber *localPort API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 访问服务器机器的IP地址
@property (nullable, copy, readonly) NSString *remoteAddress API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 访问服务器机器的端口号
@property (nullable, copy, readonly) NSNumber *remotePort API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ TLS协议的版本
@property (nullable, copy, readonly) NSNumber *negotiatedTLSProtocolVersion API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ TLS选择的加密协议
@property (nullable, copy, readonly) NSNumber *negotiatedTLSCipherSuite API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 不知道,我不论怎么切换网络环境一直都是 NO
@property (readonly, getter=isCellular) BOOL cellular API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 不知道,我不论怎么切换网络环境一直都是 NO
@property (readonly, getter=isExpensive) BOOL expensive API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 不知道,我不论怎么切换网络环境一直都是 NO
@property (readonly, getter=isConstrained) BOOL constrained API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
// iOS13+ 不知道,我不论怎么切换网络环境一直都是 NO
@property (readonly, getter=isMultipath) BOOL multipath API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));