mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 01:07:46 +00:00
Merge pull request #3208 from davotoula/fix/relaystat-deadcode-3186
Remove write-only RelayStat liveness fields
This commit is contained in:
-7
@@ -23,7 +23,6 @@ package com.vitorpamplona.quartz.nip01Core.relay.client.stats
|
||||
import androidx.collection.LruCache
|
||||
import androidx.compose.runtime.Stable
|
||||
import com.vitorpamplona.quartz.utils.TimeUtils
|
||||
import kotlin.concurrent.Volatile
|
||||
|
||||
@Stable
|
||||
class RelayStat(
|
||||
@@ -36,12 +35,6 @@ class RelayStat(
|
||||
var connectionTentatives: Int = 0,
|
||||
var connectionCompleted: Int = 0,
|
||||
) {
|
||||
// Best-effort liveness signals (epoch seconds, 0 = never). The enclosing RelayStats LruCache
|
||||
// can evict; durable per-relay history lives in commons RelayHealthStore.
|
||||
@Volatile var lastConnectAt: Long = 0
|
||||
|
||||
@Volatile var lastIncomingAt: Long = 0
|
||||
|
||||
val messages = LruCache<IRelayDebugMessage, IRelayDebugMessage>(100)
|
||||
|
||||
fun newNotice(notice: String?) {
|
||||
|
||||
-3
@@ -32,7 +32,6 @@ import com.vitorpamplona.quartz.nip01Core.relay.commands.toClient.OkMessage
|
||||
import com.vitorpamplona.quartz.nip01Core.relay.commands.toRelay.Command
|
||||
import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl
|
||||
import com.vitorpamplona.quartz.utils.Log
|
||||
import com.vitorpamplona.quartz.utils.TimeUtils
|
||||
import com.vitorpamplona.quartz.utils.bytesUsedInMemory
|
||||
|
||||
class RelayStats(
|
||||
@@ -65,7 +64,6 @@ class RelayStats(
|
||||
pingInMs = pingMillis
|
||||
compression = compressed
|
||||
connectionCompleted()
|
||||
lastConnectAt = TimeUtils.now()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +91,6 @@ class RelayStats(
|
||||
val stat = get(relay.url)
|
||||
|
||||
stat.addBytesReceived(msgStr.bytesUsedInMemory())
|
||||
stat.lastIncomingAt = TimeUtils.now()
|
||||
|
||||
when (msg) {
|
||||
is NoticeMessage -> {
|
||||
|
||||
Reference in New Issue
Block a user