Skip to content

Commit ae8f977

Browse files
committed
Log the end of the migration and it's duration
1 parent 069c0c7 commit ae8f977

File tree

1 file changed

+5
-1
lines changed
  • matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/database

1 file changed

+5
-1
lines changed

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/util/database/RealmMigrator.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@ package org.matrix.android.sdk.internal.util.database
1919
import io.realm.DynamicRealm
2020
import io.realm.RealmObjectSchema
2121
import timber.log.Timber
22+
import kotlin.system.measureTimeMillis
2223

2324
internal abstract class RealmMigrator(
2425
private val realm: DynamicRealm,
2526
private val targetSchemaVersion: Int
2627
) {
2728
fun perform() {
2829
Timber.d("Migrate ${realm.configuration.realmFileName} to $targetSchemaVersion")
29-
doMigrate(realm)
30+
val duration = measureTimeMillis {
31+
doMigrate(realm)
32+
}
33+
Timber.d("Migrate ${realm.configuration.realmFileName} to $targetSchemaVersion took $duration ms.")
3034
}
3135

3236
abstract fun doMigrate(realm: DynamicRealm)

0 commit comments

Comments
 (0)