mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2024-10-18 09:33:25 +00:00
Adds additional logs for the size of observables in the Local Cache
This commit is contained in:
parent
bc6d5060cb
commit
5e42fa5346
@ -149,8 +149,8 @@ object LocalCache {
|
|||||||
|
|
||||||
val deletionIndex = DeletionIndex()
|
val deletionIndex = DeletionIndex()
|
||||||
|
|
||||||
private val observablesByKindAndETag = ConcurrentHashMap<Int, ConcurrentHashMap<HexKey, LatestByKindWithETag<Event>>>(10)
|
val observablesByKindAndETag = ConcurrentHashMap<Int, ConcurrentHashMap<HexKey, LatestByKindWithETag<Event>>>(10)
|
||||||
private val observablesByKindAndAuthor = ConcurrentHashMap<Int, ConcurrentHashMap<HexKey, LatestByKindAndAuthor<Event>>>(10)
|
val observablesByKindAndAuthor = ConcurrentHashMap<Int, ConcurrentHashMap<HexKey, LatestByKindAndAuthor<Event>>>(10)
|
||||||
|
|
||||||
fun <T : Event> observeETag(
|
fun <T : Event> observeETag(
|
||||||
kind: Int,
|
kind: Int,
|
||||||
|
@ -1071,6 +1071,18 @@ fun debugState(context: Context) {
|
|||||||
" / " +
|
" / " +
|
||||||
LocalCache.users.size(),
|
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(
|
Log.d(
|
||||||
"STATE DUMP",
|
"STATE DUMP",
|
||||||
|
@ -110,4 +110,6 @@ class DeletionIndex {
|
|||||||
val deletionEvent = deletedReferencesBefore.get(key)
|
val deletionEvent = deletedReferencesBefore.get(key)
|
||||||
return deletionEvent != null && createdAt <= deletionEvent.createdAt
|
return deletionEvent != null && createdAt <= deletionEvent.createdAt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun size() = deletedReferencesBefore.size()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user