|
|
|
@ -63,7 +63,7 @@ class PokerAnalyticsApplication : Application() { |
|
|
|
|
|
|
|
|
|
|
|
this.createDefaultData() |
|
|
|
this.createDefaultData() |
|
|
|
if (BuildConfig.DEBUG) { |
|
|
|
if (BuildConfig.DEBUG) { |
|
|
|
// this.createFakeSessions() // debug |
|
|
|
this.createFakeSessions() // debug |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@ -137,8 +137,11 @@ class PokerAnalyticsApplication : Application() { |
|
|
|
val sessions = realm.where<Session>().findAll() |
|
|
|
val sessions = realm.where<Session>().findAll() |
|
|
|
if (sessions.size < 10) { |
|
|
|
if (sessions.size < 10) { |
|
|
|
|
|
|
|
|
|
|
|
val numberOfSessions = 1000 |
|
|
|
val numberOfSessions = 50 |
|
|
|
Timber.d("Creating ${numberOfSessions} fake sessions...") |
|
|
|
Timber.d("> Start creating ${numberOfSessions} fake sessions...") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val s = Date() |
|
|
|
|
|
|
|
|
|
|
|
for (index in 0..numberOfSessions) { |
|
|
|
for (index in 0..numberOfSessions) { |
|
|
|
|
|
|
|
|
|
|
|
realm.executeTransaction { |
|
|
|
realm.executeTransaction { |
|
|
|
@ -187,7 +190,9 @@ class PokerAnalyticsApplication : Application() { |
|
|
|
realm.copyToRealmOrUpdate(session) |
|
|
|
realm.copyToRealmOrUpdate(session) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
Timber.d("Creation of sessions ended") |
|
|
|
val e = Date() |
|
|
|
|
|
|
|
val duration = (e.time - s.time) / 1000.0 |
|
|
|
|
|
|
|
Timber.d("> ended in ${duration} seconds") |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|