From 2e71f38f00b245b2c5ff7cf4edf28e291cfffe4f Mon Sep 17 00:00:00 2001 From: Valere Date: Tue, 30 Nov 2021 16:52:11 +0100 Subject: [PATCH] quick log improvents --- .../android/sdk/internal/crypto/DefaultCryptoService.kt | 7 ++++++- .../android/sdk/internal/crypto/tasks/SendEventTask.kt | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt index dffc100e7a..d970517c9a 100755 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt @@ -90,6 +90,7 @@ import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.AtomicBoolean import javax.inject.Inject import kotlin.math.max +import kotlin.system.measureTimeMillis /** * A `CryptoService` class instance manages the end-to-end crypto for a session. @@ -542,7 +543,11 @@ internal class DefaultCryptoService @Inject constructor( val t0 = System.currentTimeMillis() Timber.tag(loggerTag.value).v("encryptEventContent() starts") runCatching { - preshareRoomKey(roomId, userIds) + measureTimeMillis { + preshareRoomKey(roomId, userIds) + }.also { + Timber.d("Shared room key in room $roomId took $it ms") + } val content = encrypt(roomId, eventType, eventContent) Timber.tag(loggerTag.value).v("## CRYPTO | encryptEventContent() : succeeds after ${System.currentTimeMillis() - t0} ms") MXEncryptEventContentResult(content, EventType.ENCRYPTED) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendEventTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendEventTask.kt index bdfe818c62..6620c1c6cc 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendEventTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/SendEventTask.kt @@ -60,6 +60,7 @@ internal class DefaultSendEventTask @Inject constructor( eventType = event.type ?: "" ) } + Timber.d("Event sent to ${event.roomId} with event id ${response.eventId}") localEchoRepository.updateSendState(localId, params.event.roomId, SendState.SENT) return response.eventId.also { Timber.d("Event: $it just sent in ${params.event.roomId}")