tracks and displays connection tentatives on relay settings
This commit is contained in:
+10
@@ -32,6 +32,8 @@ class RelayStat(
|
||||
var errorCounter: Int = 0,
|
||||
var pingInMs: Int = 0,
|
||||
var compression: Boolean = false,
|
||||
var connectionTentatives: Int = 0,
|
||||
var connectionCompleted: Int = 0,
|
||||
) {
|
||||
val messages = LruCache<IRelayDebugMessage, IRelayDebugMessage>(100)
|
||||
|
||||
@@ -63,6 +65,14 @@ class RelayStat(
|
||||
sentBytes += bytesUsedInMemory
|
||||
}
|
||||
|
||||
fun newConnection() {
|
||||
connectionTentatives++
|
||||
}
|
||||
|
||||
fun connectionCompleted() {
|
||||
connectionCompleted++
|
||||
}
|
||||
|
||||
fun newSpam(
|
||||
link1: String,
|
||||
link2: String,
|
||||
|
||||
+8
@@ -46,6 +46,13 @@ class RelayStats(
|
||||
|
||||
private val clientListener =
|
||||
object : IRelayClientListener {
|
||||
override fun onConnecting(relay: IRelayClient) {
|
||||
super.onConnecting(relay)
|
||||
with(get(relay.url)) {
|
||||
newConnection()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onConnected(
|
||||
relay: IRelayClient,
|
||||
pingMillis: Int,
|
||||
@@ -54,6 +61,7 @@ class RelayStats(
|
||||
with(get(relay.url)) {
|
||||
pingInMs = pingMillis
|
||||
compression = compressed
|
||||
connectionCompleted()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user