|
@@ -48,21 +48,14 @@ |
|
@@ -48,21 +48,14 @@ |
48
|
* 间隔发送时间
|
48
|
* 间隔发送时间
|
49
|
*/
|
49
|
*/
|
50
|
@property (assign, nonatomic) NSTimeInterval currentInterval;
|
50
|
@property (assign, nonatomic) NSTimeInterval currentInterval;
|
51
|
-/**
|
|
|
52
|
- * 最近一个事件
|
|
|
53
|
- */
|
|
|
54
|
-@property (strong, nonatomic) YHEvent *event;
|
|
|
55
|
-/**
|
|
|
56
|
- * 最近一个错误
|
|
|
57
|
- */
|
|
|
58
|
-@property (strong, nonatomic) YHError *error;
|
|
|
59
|
-
|
|
|
60
|
-/**
|
|
|
61
|
- @brief 最近一个Performance信息
|
|
|
62
|
-
|
|
|
63
|
- @since 1.0
|
|
|
64
|
- */
|
|
|
65
|
-@property (strong, nonatomic) YHPerformance *perfermance;
|
51
|
+///**
|
|
|
52
|
+// * 最近一个事件
|
|
|
53
|
+// */
|
|
|
54
|
+//@property (strong, nonatomic) YHEvent *event;
|
|
|
55
|
+///**
|
|
|
56
|
+// * 最近一个错误
|
|
|
57
|
+// */
|
|
|
58
|
+//@property (strong, nonatomic) YHError *error;
|
66
|
|
59
|
|
67
|
|
60
|
|
68
|
- (NSString *)timestamp;
|
61
|
- (NSString *)timestamp;
|
|
@@ -127,8 +120,8 @@ |
|
@@ -127,8 +120,8 @@ |
127
|
self.timer = nil;
|
120
|
self.timer = nil;
|
128
|
}
|
121
|
}
|
129
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
122
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
130
|
- self.event = nil;
|
|
|
131
|
- self.error = nil;
|
123
|
+// self.event = nil;
|
|
|
124
|
+// self.error = nil;
|
132
|
}
|
125
|
}
|
133
|
|
126
|
|
134
|
#pragma mark - Properties
|
127
|
#pragma mark - Properties
|
|
@@ -270,21 +263,21 @@ |
|
@@ -270,21 +263,21 @@ |
270
|
- (void)logEvent:(NSString *)eventId parameters:(NSDictionary *)param
|
263
|
- (void)logEvent:(NSString *)eventId parameters:(NSDictionary *)param
|
271
|
{
|
264
|
{
|
272
|
YALog(@"logEvent %@, %@", eventId, param);
|
265
|
YALog(@"logEvent %@, %@", eventId, param);
|
273
|
- self.event = [[YHEvent alloc] init];
|
|
|
274
|
- self.event.op = eventId;
|
|
|
275
|
- self.event.uid = self.uid ? self.uid : @"";
|
|
|
276
|
- self.event.ts = [self timestamp];
|
|
|
277
|
- self.event.sid = self.session;
|
266
|
+ YHEvent *event = [[YHEvent alloc] init];
|
|
|
267
|
+ event.op = eventId;
|
|
|
268
|
+ event.uid = self.uid ? self.uid : @"";
|
|
|
269
|
+ event.ts = [self timestamp];
|
|
|
270
|
+ event.sid = self.session;
|
278
|
self.eventIndex++;
|
271
|
self.eventIndex++;
|
279
|
- self.event.index = [NSString stringWithFormat:@"%lu", (unsigned long)self.eventIndex];
|
|
|
280
|
- self.event.param = param;
|
|
|
281
|
- self.event.cid = self.cid?:@"";
|
272
|
+ event.index = [NSString stringWithFormat:@"%lu", (unsigned long)self.eventIndex];
|
|
|
273
|
+ event.param = param;
|
|
|
274
|
+ event.cid = self.cid?:@"";
|
282
|
|
275
|
|
283
|
// 立即发送策略
|
276
|
// 立即发送策略
|
284
|
if ((self.logStrategy & LogStrategyImmedi) != 0) {
|
277
|
if ((self.logStrategy & LogStrategyImmedi) != 0) {
|
285
|
- [[YHAssemblyAssistant sharedInstance] uploadImmedilyWithEvent:self.event];
|
278
|
+ [[YHAssemblyAssistant sharedInstance] uploadImmedilyWithEvent:event];
|
286
|
} else {
|
279
|
} else {
|
287
|
- [[YHAssemblyAssistant sharedInstance] saveItemData:self.event];
|
280
|
+ [[YHAssemblyAssistant sharedInstance] saveItemData:event];
|
288
|
}
|
281
|
}
|
289
|
|
282
|
|
290
|
|
283
|
|
|
@@ -295,19 +288,19 @@ |
|
@@ -295,19 +288,19 @@ |
295
|
{
|
288
|
{
|
296
|
YALog(@"logError %@, %@", errorType, param);
|
289
|
YALog(@"logError %@, %@", errorType, param);
|
297
|
|
290
|
|
298
|
- self.error = [[YHError alloc] init];
|
|
|
299
|
- self.error.et = errorType;
|
|
|
300
|
- self.error.uid = self.uid ? self.uid : @"";
|
|
|
301
|
- self.error.ts = [self timestamp];
|
|
|
302
|
- self.error.sid = self.session;
|
|
|
303
|
- self.error.param = param;
|
|
|
304
|
- self.error.cid = self.cid?:@"";
|
291
|
+ YHError *error = [[YHError alloc] init];
|
|
|
292
|
+ error.et = errorType;
|
|
|
293
|
+ error.uid = self.uid ? self.uid : @"";
|
|
|
294
|
+ error.ts = [self timestamp];
|
|
|
295
|
+ error.sid = self.session;
|
|
|
296
|
+ error.param = param;
|
|
|
297
|
+ error.cid = self.cid?:@"";
|
305
|
|
298
|
|
306
|
// crash 不支持立即发送
|
299
|
// crash 不支持立即发送
|
307
|
if ((self.logStrategy & LogStrategyImmedi) != 0 && ![errorType isEqualToString:kErrorTypeCrash]) {
|
300
|
if ((self.logStrategy & LogStrategyImmedi) != 0 && ![errorType isEqualToString:kErrorTypeCrash]) {
|
308
|
- [[YHAssemblyAssistant sharedInstance] uploadImmedilyWithEvent:self.error];
|
301
|
+ [[YHAssemblyAssistant sharedInstance] uploadImmedilyWithEvent:error];
|
309
|
} else {
|
302
|
} else {
|
310
|
- [[YHAssemblyAssistant sharedInstance] saveItemData:self.error];
|
303
|
+ [[YHAssemblyAssistant sharedInstance] saveItemData:error];
|
311
|
}
|
304
|
}
|
312
|
}
|
305
|
}
|
313
|
|
306
|
|
|
@@ -316,13 +309,13 @@ |
|
@@ -316,13 +309,13 @@ |
316
|
{
|
309
|
{
|
317
|
YALog(@"perfType %@, %@", perfType, param);
|
310
|
YALog(@"perfType %@, %@", perfType, param);
|
318
|
|
311
|
|
319
|
- self.perfermance = [[YHPerformance alloc] init];
|
|
|
320
|
- self.perfermance.type = perfType;
|
|
|
321
|
- self.perfermance.uid = self.uid ? self.uid : @"";
|
|
|
322
|
- self.perfermance.ts = [self timestamp];
|
|
|
323
|
- self.perfermance.sid = self.session;
|
|
|
324
|
- self.perfermance.param = param;
|
|
|
325
|
- self.perfermance.cid = self.cid?:@"";
|
312
|
+ YHPerformance *perfermance = [[YHPerformance alloc] init];
|
|
|
313
|
+ perfermance.type = perfType;
|
|
|
314
|
+ perfermance.uid = self.uid ? self.uid : @"";
|
|
|
315
|
+ perfermance.ts = [self timestamp];
|
|
|
316
|
+ perfermance.sid = self.session;
|
|
|
317
|
+ perfermance.param = param;
|
|
|
318
|
+ perfermance.cid = self.cid?:@"";
|
326
|
// 立即发送策略
|
319
|
// 立即发送策略
|
327
|
// if ((self.logStrategy & LogStrategyImmedi) != 0) {
|
320
|
// if ((self.logStrategy & LogStrategyImmedi) != 0) {
|
328
|
// [[YHAssemblyAssistant sharedInstance] uploadImmedilyWithEvent:self.perfermance];
|
321
|
// [[YHAssemblyAssistant sharedInstance] uploadImmedilyWithEvent:self.perfermance];
|
|
@@ -331,7 +324,7 @@ |
|
@@ -331,7 +324,7 @@ |
331
|
// }
|
324
|
// }
|
332
|
|
325
|
|
333
|
// 性能统计事件不需要立即发送
|
326
|
// 性能统计事件不需要立即发送
|
334
|
- [[YHAssemblyAssistant sharedInstance]savePerformanceData:self.perfermance];
|
327
|
+ [[YHAssemblyAssistant sharedInstance]savePerformanceData:perfermance];
|
335
|
}
|
328
|
}
|
336
|
|
329
|
|
337
|
// 首次安装的首次启动时发送
|
330
|
// 首次安装的首次启动时发送
|