...
|
...
|
@@ -270,6 +270,29 @@ static dispatch_queue_t persisting_queue() { |
|
|
}
|
|
|
|
|
|
#pragma mark - 持久化数据
|
|
|
- (void)savePerformanceData:(YHPerformance *)perf
|
|
|
{
|
|
|
if (perf == nil || ![perf isKindOfClass:[YHPerformance class]]) {
|
|
|
NSException *exception = [NSException exceptionWithName:NSInvalidArgumentException
|
|
|
reason:@"The input parameter is nil or an unexpected value."
|
|
|
userInfo:nil];
|
|
|
[exception raise];
|
|
|
|
|
|
}
|
|
|
|
|
|
if ([self canPersisting]) {
|
|
|
perf.net = self.currentStatus.net;
|
|
|
|
|
|
dispatch_async(persisting_queue(), ^{
|
|
|
|
|
|
if ([self writePerformanceToFile:perf]) {
|
|
|
[self autoUploadData];
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
- (void)saveItemData:(YHAnalyItemData *)itemData
|
|
|
{
|
|
|
if (itemData == nil || ![itemData isKindOfClass:[YHAnalyItemData class]]) {
|
...
|
...
|
@@ -652,6 +675,8 @@ static dispatch_queue_t persisting_queue() { |
|
|
collectData = [[NSMutableDictionary alloc]init];
|
|
|
|
|
|
//直接添加 immediUploadDataDic 内容(里面包含 device 信息)
|
|
|
[self.immediUploadItemDic removeObjectForKey:JsonKeyDataTypeErrors];
|
|
|
[self.immediUploadItemDic removeObjectForKey:JsonKeyDataTypeEvents];
|
|
|
[collectData addEntriesFromDictionary:self.immediUploadItemDic];
|
|
|
|
|
|
//组合performance信息
|
...
|
...
|
|