|
|
@ -34,13 +34,13 @@ public class ABTestEventDao extends DatabaseDao<ABTestEvent> {
|
|
|
|
createNew(event);
|
|
|
|
createNew(event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public boolean createTestEventWithTimeInterval(String testName, int timeInterval) {
|
|
|
|
private void createTestEventWithTimeInterval(String testName, int timeInterval) {
|
|
|
|
TodorooCursor<ABTestEvent> existing = query(Query.select(ABTestEvent.PROPERTIES)
|
|
|
|
TodorooCursor<ABTestEvent> existing = query(Query.select(ABTestEvent.PROPERTIES)
|
|
|
|
.where(ABTestEvent.TEST_NAME.eq(testName)).orderBy(Order.asc(ABTestEvent.TIME_INTERVAL)));
|
|
|
|
.where(ABTestEvent.TEST_NAME.eq(testName)).orderBy(Order.asc(ABTestEvent.TIME_INTERVAL)));
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (existing.getCount() == 0)
|
|
|
|
if (existing.getCount() == 0)
|
|
|
|
return false;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
existing.moveToLast();
|
|
|
|
existing.moveToLast();
|
|
|
|
ABTestEvent item = new ABTestEvent(existing);
|
|
|
|
ABTestEvent item = new ABTestEvent(existing);
|
|
|
@ -51,7 +51,7 @@ public class ABTestEventDao extends DatabaseDao<ABTestEvent> {
|
|
|
|
ABTestEvent.TIME_INTERVALS, timeInterval);
|
|
|
|
ABTestEvent.TIME_INTERVALS, timeInterval);
|
|
|
|
|
|
|
|
|
|
|
|
if (lastRecordedTimeIntervalIndex < 0 || currentTimeIntervalIndex < 0)
|
|
|
|
if (lastRecordedTimeIntervalIndex < 0 || currentTimeIntervalIndex < 0)
|
|
|
|
return false;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
long now = DateUtilities.now();
|
|
|
|
long now = DateUtilities.now();
|
|
|
|
for (int i = lastRecordedTimeIntervalIndex + 1; i <= currentTimeIntervalIndex; i++) {
|
|
|
|
for (int i = lastRecordedTimeIntervalIndex + 1; i <= currentTimeIntervalIndex; i++) {
|
|
|
@ -64,7 +64,7 @@ public class ABTestEventDao extends DatabaseDao<ABTestEvent> {
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
existing.close();
|
|
|
|
existing.close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void createRelativeDateEvents() {
|
|
|
|
public void createRelativeDateEvents() {
|
|
|
|