Skip to content

Commit

Permalink
Merge pull request #364 from YangSen-qn/develop
Browse files Browse the repository at this point in the history
change up log key and status_code logic
  • Loading branch information
bachue authored Sep 16, 2020
2 parents 05c17e4 + fa327d7 commit d6b8ba1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions QiniuSDK/Collect/QNReportItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ - (void)reportItem:(QNReportItem *)item token:(NSString *)token{
@implementation QNResponseInfo(Report)

- (NSNumber *)requestReportStatusCode{
if (self.statusCode > -10 && self.statusCode < 0) {
return @(self.statusCode);
} else {
return nil;
}
return @(self.statusCode);
}

- (NSString *)requestReportErrorType{
Expand Down Expand Up @@ -135,7 +131,10 @@ - (NSString *)qualityResult{

if (self.statusCode > 199 && self.statusCode < 300) {
result = @"ok";
} else if (self.statusCode > 399 && self.statusCode < 500) {
} else if (self.statusCode > 399 &&
(self.statusCode < 500 || self.statusCode == 573 || self.statusCode == 579 ||
self.statusCode == 608 || self.statusCode == 612 || self.statusCode == 614 || self.statusCode == 630 || self.statusCode == 631 ||
self.statusCode == 701)) {
result = @"bad_request";
} else if (self.statusCode == kQNZeroDataSize){
result = @"zero_size_file";
Expand Down Expand Up @@ -172,7 +171,7 @@ - (NSString *)qualityResult{
NSString * const QNReportRequestKeyPort = @"port";
NSString * const QNReportRequestKeyTargetBucket = @"target_bucket";
NSString * const QNReportRequestKeyTargetKey = @"target_key";
NSString * const QNReportRequestKeyTotalElapsedTime = @"total_elaspsed_time";
NSString * const QNReportRequestKeyTotalElapsedTime = @"total_elapsed_time";
NSString * const QNReportRequestKeyDnsElapsedTime = @"dns_elapsed_time";
NSString * const QNReportRequestKeyConnectElapsedTime = @"connect_elapsed_time";
NSString * const QNReportRequestKeyTLSConnectElapsedTime = @"tls_connect_elapsed_time";
Expand Down Expand Up @@ -205,7 +204,7 @@ - (NSString *)qualityResult{
NSString *const QNReportBlockKeyUpTime = @"up_time";
NSString * const QNReportBlockKeyTargetRegionId = @"target_region_id";
NSString * const QNReportBlockKeyCurrentRegionId = @"current_region_id";
NSString * const QNReportBlockKeyTotalElapsedTime = @"total_elaspsed_time";
NSString * const QNReportBlockKeyTotalElapsedTime = @"total_elapsed_time";
NSString * const QNReportBlockKeyBytesSent = @"bytes_sent";
NSString * const QNReportBlockKeyRecoveredFrom = @"recovered_from";
NSString * const QNReportBlockKeyFileSize = @"file_size";
Expand All @@ -219,7 +218,7 @@ - (NSString *)qualityResult{
NSString * const QNReportQualityKeyLogType = @"log_type";
NSString *const QNReportQualityKeyUpTime = @"up_time";
NSString * const QNReportQualityKeyResult = @"result";
NSString * const QNReportQualityKeyTotalElapsedTime = @"total_elaspsed_time";
NSString * const QNReportQualityKeyTotalElapsedTime = @"total_elapsed_time";
NSString * const QNReportQualityKeyRequestsCount = @"requests_count";
NSString * const QNReportQualityKeyRegionsCount = @"regions_count";
NSString * const QNReportQualityKeyBytesSent = @"bytes_sent";
Expand Down

0 comments on commit d6b8ba1

Please sign in to comment.