Adds additional logs for the size of observables in the Local Cache

pull/982/head
Vitor Pamplona 2024-07-17 09:09:38 -04:00
rodzic bc6d5060cb
commit 5e42fa5346
3 zmienionych plików z 16 dodań i 2 usunięć

Wyświetl plik

@ -149,8 +149,8 @@ object LocalCache {
val deletionIndex = DeletionIndex()
private val observablesByKindAndETag = ConcurrentHashMap<Int, ConcurrentHashMap<HexKey, LatestByKindWithETag<Event>>>(10)
private val observablesByKindAndAuthor = ConcurrentHashMap<Int, ConcurrentHashMap<HexKey, LatestByKindAndAuthor<Event>>>(10)
val observablesByKindAndETag = ConcurrentHashMap<Int, ConcurrentHashMap<HexKey, LatestByKindWithETag<Event>>>(10)
val observablesByKindAndAuthor = ConcurrentHashMap<Int, ConcurrentHashMap<HexKey, LatestByKindAndAuthor<Event>>>(10)
fun <T : Event> observeETag(
kind: Int,

Wyświetl plik

@ -1071,6 +1071,18 @@ fun debugState(context: Context) {
" / " +
LocalCache.users.size(),
)
Log.d(
"STATE DUMP",
"Deletion Events: " +
LocalCache.deletionIndex.size(),
)
Log.d(
"STATE DUMP",
"Observable Events: " +
LocalCache.observablesByKindAndETag.size +
" / " +
LocalCache.observablesByKindAndAuthor.size,
)
Log.d(
"STATE DUMP",

Wyświetl plik

@ -110,4 +110,6 @@ class DeletionIndex {
val deletionEvent = deletedReferencesBefore.get(key)
return deletionEvent != null && createdAt <= deletionEvent.createdAt
}
fun size() = deletedReferencesBefore.size()
}