QNUploadRequestMetrics.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // QNUploadRequestMetrics.h
  3. // QiniuSDK
  4. //
  5. // Created by yangsen on 2020/4/29.
  6. // Copyright © 2020 Qiniu. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "QNUploadRegionInfo.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. @interface QNUploadSingleRequestMetrics : NSObject
  12. @property (nonatomic, copy) NSURLRequest *request;
  13. @property (nullable , copy) NSURLResponse *response;
  14. @property (nullable, copy) NSDate *startDate;
  15. @property (nullable, copy) NSDate *endDate;
  16. @property (nonatomic, strong, readonly) NSNumber *totalElapsedTime;
  17. @property (nullable, copy) NSDate *domainLookupStartDate;
  18. @property (nullable, copy) NSDate *domainLookupEndDate;
  19. @property (nonatomic, strong, readonly) NSNumber *totalDnsTime;
  20. @property (nullable, copy) NSDate *connectStartDate;
  21. @property (nullable, copy) NSDate *connectEndDate;
  22. @property (nonatomic, strong, readonly) NSNumber *totalConnectTime;
  23. @property (nullable, copy) NSDate *secureConnectionStartDate;
  24. @property (nullable, copy) NSDate *secureConnectionEndDate;
  25. @property (nonatomic, strong, readonly) NSNumber *totalSecureConnectTime;
  26. @property (nullable, copy) NSDate *requestStartDate;
  27. @property (nullable, copy) NSDate *requestEndDate;
  28. @property (nonatomic, strong, readonly) NSNumber *totalRequestTime;
  29. @property (nonatomic, strong, readonly) NSNumber *totalWaitTime;
  30. @property (nullable, copy) NSDate *responseStartDate;
  31. @property (nullable, copy) NSDate *responseEndDate;
  32. @property (nonatomic, strong, readonly) NSNumber *totalResponseTime;
  33. @property (assign) int64_t countOfRequestHeaderBytesSent;
  34. @property (assign) int64_t countOfRequestBodyBytesSent;
  35. @property (assign) int64_t countOfResponseHeaderBytesReceived;
  36. @property (assign) int64_t countOfResponseBodyBytesReceived;
  37. @property (nullable, copy) NSString *localAddress;
  38. @property (nullable, copy) NSNumber *localPort;
  39. @property (nullable, copy) NSString *remoteAddress;
  40. @property (nullable, copy) NSNumber *remotePort;
  41. @property (nonatomic, strong, readonly) NSNumber *totalBytes;
  42. @property (nonatomic, strong, readonly) NSNumber *bytesSend;
  43. //MARK:-- 构造
  44. + (instancetype)emptyMetrics;
  45. @end
  46. @interface QNUploadRegionRequestMetrics : NSObject
  47. @property (nonatomic, strong, readonly) NSNumber *totalElapsedTime;
  48. @property (nonatomic, strong, readonly) NSNumber *requestCount;
  49. @property (nonatomic, strong, readonly) NSNumber *bytesSend;
  50. @property (nonatomic, strong, readonly) id <QNUploadRegion> region;
  51. @property (nonatomic, copy, readonly) NSArray<QNUploadSingleRequestMetrics *> *metricsList;
  52. //MARK:-- 构造
  53. + (instancetype)emptyMetrics;
  54. - (instancetype)initWithRegion:(id <QNUploadRegion>)region;
  55. - (void)addMetricsList:(NSArray <QNUploadSingleRequestMetrics *> *)metricsList;
  56. - (void)addMetrics:(QNUploadRegionRequestMetrics*)metrics;
  57. @end
  58. @interface QNUploadTaskMetrics : NSObject
  59. @property (nonatomic, strong, readonly) NSNumber *totalElapsedTime;
  60. @property (nonatomic, strong, readonly) NSNumber *requestCount;
  61. @property (nonatomic, strong, readonly) NSNumber *bytesSend;
  62. @property (nonatomic, strong, readonly) NSNumber *regionCount;
  63. @property (nonatomic, strong) NSArray<id <QNUploadRegion>> *regions;
  64. //MARK:-- 构造
  65. + (instancetype)emptyMetrics;
  66. - (void)addMetrics:(QNUploadRegionRequestMetrics *)metrics;
  67. @end
  68. NS_ASSUME_NONNULL_END