Authored by John Tai

修复sdwebimage下载时间统计的bug.reviewed by yulaing

@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 { 53 {
54 54
55 if ([YHEventReport sharedInstance].isPerformanceTrackEnabled && [YHEventReport sharedInstance].isImagePerformanceTrackEnable){ 55 if ([YHEventReport sharedInstance].isPerformanceTrackEnabled && [YHEventReport sharedInstance].isImagePerformanceTrackEnable){
56 - [[YH_EventCollector sharedInstance] timeEventStartWithWebImageDownload:self]; 56 + [[YH_EventCollector sharedInstance] timeEventStartWithWebImageDownloadURL:url.absoluteString];
57 } 57 }
58 58
59 return [self yher_downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) { 59 return [self yher_downloadImageWithURL:url options:options progress:progressBlock completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
@@ -61,9 +61,8 @@ @@ -61,9 +61,8 @@
61 if ([YHEventReport sharedInstance].isPerformanceTrackEnabled && [YHEventReport sharedInstance].isImagePerformanceTrackEnable){ 61 if ([YHEventReport sharedInstance].isPerformanceTrackEnabled && [YHEventReport sharedInstance].isImagePerformanceTrackEnable){
62 if (cacheType == SDImageCacheTypeNone) {//暂时只去下载的图片的时间,过滤掉读缓存的时间 62 if (cacheType == SDImageCacheTypeNone) {//暂时只去下载的图片的时间,过滤掉读缓存的时间
63 if (error) { 63 if (error) {
64 - [[YH_EventCollector sharedInstance] timeEventEndWithWebImageDownload:self url:[NSString stringWithFormat:@"%@",url] status:YHEventLoadStatusFailed];  
65 - }else{  
66 - [[YH_EventCollector sharedInstance] timeEventEndWithWebImageDownload:self url:[NSString stringWithFormat:@"%@",url] status:YHEventLoadStatusSuc]; 64 + [[YH_EventCollector sharedInstance] timeEventEndWithWebImageDownloadURL:url.absoluteString status:YHEventLoadStatusFailed];
  65 + [[YH_EventCollector sharedInstance] timeEventEndWithWebImageDownloadURL:url.absoluteString status:YHEventLoadStatusSuc];
67 } 66 }
68 } 67 }
69 } 68 }
@@ -21,8 +21,8 @@ @@ -21,8 +21,8 @@
21 - (void)timeEventStartWithWebView:(UIWebView *)webView; 21 - (void)timeEventStartWithWebView:(UIWebView *)webView;
22 - (void)timeEventEndWithWebView:(UIWebView *)webView status:(YHEventLoadStatus)status; 22 - (void)timeEventEndWithWebView:(UIWebView *)webView status:(YHEventLoadStatus)status;
23 23
24 -- (void)timeEventStartWithWebImageDownload:(SDWebImageManager *)downloaderOperation;  
25 -- (void)timeEventEndWithWebImageDownload:(SDWebImageManager *)downloaderOperation url:(NSString*)url status:(YHEventLoadStatus)status; 24 +- (void)timeEventStartWithWebImageDownloadURL:(NSString *)imageURL;
  25 +- (void)timeEventEndWithWebImageDownloadURL:(NSString*)imageURL status:(YHEventLoadStatus)status;
26 26
27 - (void)timeEventStartWithUIControl:(UIControl *)control; 27 - (void)timeEventStartWithUIControl:(UIControl *)control;
28 - (void)timeEventEndWithUIControl:(UIControl *)control; 28 - (void)timeEventEndWithUIControl:(UIControl *)control;