...
|
...
|
@@ -277,33 +277,34 @@ |
|
|
}
|
|
|
|
|
|
#pragma mark - UIImageView download performance
|
|
|
- (void)timeEventStartWithWebImageDownload:(SDWebImageManager *)downloaderOperation
|
|
|
- (void)timeEventStartWithWebImageDownloadURL:(NSString *)imageURL
|
|
|
{
|
|
|
NSNumber *startTime = @([[NSDate date] timeIntervalSince1970]);
|
|
|
NSString *yh_webImageId = [NSString stringWithFormat:@"%@",startTime];
|
|
|
if (startTime==0||IsStrEmpty(yh_webImageId)) {
|
|
|
if (startTime==0||IsStrEmpty(imageURL)) {
|
|
|
return;
|
|
|
}
|
|
|
downloaderOperation.yh_webImageId=yh_webImageId;
|
|
|
dispatch_async(self.serialQueue, ^{
|
|
|
self.timedEvents[yh_webImageId] = startTime;
|
|
|
self.timedEvents[imageURL] = startTime;
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- (void)timeEventEndWithWebImageDownload:(SDWebImageManager *)downloaderOperation url:(NSString*)url status:(YHEventLoadStatus)status
|
|
|
- (void)timeEventEndWithWebImageDownloadURL:(NSString*)imageURL status:(YHEventLoadStatus)status
|
|
|
{
|
|
|
NSTimeInterval elapsedTime = [self eventElapsedTime:downloaderOperation.yh_webImageId];
|
|
|
if (elapsedTime==0) {
|
|
|
if (IsStrEmpty(imageURL)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (!IsStrEmpty(downloaderOperation.yh_webImageId)) {
|
|
|
dispatch_async(self.serialQueue, ^{
|
|
|
[self.timedEvents removeObjectForKey:downloaderOperation.yh_webImageId];
|
|
|
});
|
|
|
NSTimeInterval elapsedTime = [self eventElapsedTime:imageURL];
|
|
|
if (elapsedTime==0) {
|
|
|
return;
|
|
|
}
|
|
|
NSDictionary *param = [YH_EventDataFactory factoryTimeEventDataWithSDWebImageDownloader:downloaderOperation ElapsedTime:elapsedTime status:status url:url];
|
|
|
if (param && status == YHEventLoadStatusSuc) {
|
|
|
|
|
|
dispatch_async(self.serialQueue, ^{
|
|
|
[self.timedEvents removeObjectForKey:imageURL];
|
|
|
});
|
|
|
|
|
|
NSDictionary *param = [YH_EventDataFactory factoryTimeEventDataWithElapsedTime:elapsedTime status:status url:imageURL];
|
|
|
if (param && status == YHEventLoadStatusSuc) {
|
|
|
[[YH_EventCacheManager sharedInstance] pushPerformanceData:param pointName:YHPN_IMAGEVIEW];
|
|
|
}
|
|
|
}
|
...
|
...
|
|