|
|
|
@ -61,15 +61,13 @@ public final class ABTestEventReportingService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void pushAllUnreportedABTestEvents() {
|
|
|
|
private void pushAllUnreportedABTestEvents() {
|
|
|
|
|
|
|
|
synchronized(ABTestEventReportingService.class) {
|
|
|
|
if (StatisticsService.dontCollectStatistics())
|
|
|
|
if (StatisticsService.dontCollectStatistics())
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
final TodorooCursor<ABTestEvent> unreported = abTestEventDao.query(Query.select(ABTestEvent.PROPERTIES)
|
|
|
|
final TodorooCursor<ABTestEvent> unreported = abTestEventDao.query(Query.select(ABTestEvent.PROPERTIES)
|
|
|
|
.where(ABTestEvent.REPORTED.eq(0))
|
|
|
|
.where(ABTestEvent.REPORTED.eq(0))
|
|
|
|
.orderBy(Order.asc(ABTestEvent.TEST_NAME), Order.asc(ABTestEvent.TIME_INTERVAL)));
|
|
|
|
.orderBy(Order.asc(ABTestEvent.TEST_NAME), Order.asc(ABTestEvent.TIME_INTERVAL)));
|
|
|
|
if (unreported.getCount() > 0) {
|
|
|
|
if (unreported.getCount() > 0) {
|
|
|
|
new Thread(new Runnable() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
JSONArray payload = jsonArrayFromABTestEvents(unreported);
|
|
|
|
JSONArray payload = jsonArrayFromABTestEvents(unreported);
|
|
|
|
abTestInvoker.post(payload);
|
|
|
|
abTestInvoker.post(payload);
|
|
|
|
@ -87,7 +85,6 @@ public final class ABTestEventReportingService {
|
|
|
|
unreported.close();
|
|
|
|
unreported.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).start();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|