mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
debug(relay): log per-assembler relay count on invalidation
After fixing the stale connected-count, the background footprint settles at ~25 relays (desired=22) — higher than the inbox+DM target. Add a per-EoseManager log (assembler name -> key count + distinct relay count) so we can attribute the 25 to specific always-on loaders (metadata/drafts on homeRelays, gift-wrap history, marmot groups, notifications) and trim precisely instead of guessing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ukw6FJPFh3JKGXL532p3ae
This commit is contained in:
+2
@@ -22,6 +22,7 @@ package com.vitorpamplona.amethyst.commons.relayClient.eoseManagers
|
||||
|
||||
import com.vitorpamplona.amethyst.commons.service.BundledUpdate
|
||||
import com.vitorpamplona.quartz.nip01Core.relay.client.INostrClient
|
||||
import com.vitorpamplona.quartz.utils.Log
|
||||
import com.vitorpamplona.quartz.nip01Core.relay.client.reqs.SubscriptionListener
|
||||
import com.vitorpamplona.quartz.nip01Core.relay.client.single.newSubId
|
||||
import com.vitorpamplona.quartz.nip01Core.relay.client.subscriptions.SubscriptionController
|
||||
@@ -53,6 +54,7 @@ abstract class BaseEoseManager<T>(
|
||||
fun forceInvalidate() {
|
||||
updateSubscriptions(allKeys())
|
||||
orchestrator.updateRelays()
|
||||
Log.d("BgRelayTrace") { "${this::class.simpleName} — keys=${allKeys().size}, relays=${orchestrator.activeRelays().size}" }
|
||||
}
|
||||
|
||||
override fun destroy() {
|
||||
|
||||
+7
@@ -51,6 +51,13 @@ class SubscriptionController(
|
||||
|
||||
fun getSub(subId: String) = subscriptions.get(subId)
|
||||
|
||||
/** Distinct relays across all active subscriptions managed by this controller. */
|
||||
fun activeRelays(): Set<NormalizedRelayUrl> {
|
||||
val relays = mutableSetOf<NormalizedRelayUrl>()
|
||||
subscriptions.forEach { _, sub -> sub.filters()?.keys?.let { relays.addAll(it) } }
|
||||
return relays
|
||||
}
|
||||
|
||||
fun requestNewSubscription(
|
||||
subId: String,
|
||||
listener: SubscriptionListener,
|
||||
|
||||
Reference in New Issue
Block a user