feat: Waku Sync dashboard new panel & update (#3379)

This commit is contained in:
Simon-Pierre Vivier 2025-04-22 08:37:11 -04:00 committed by GitHub
parent 8dd31c200b
commit 2f49aae2b7
4 changed files with 570 additions and 266 deletions

File diff suppressed because it is too large Load Diff

View File

@ -8,13 +8,13 @@ const
declarePublicHistogram reconciliation_roundtrips,
"the nubmer of roundtrips for each reconciliation",
buckets = [0.0, 1.0, 2.0, 3.0, 5.0, 10.0, Inf]
buckets = [1.0, 2.0, 3.0, 5.0, 8.0, 13.0, Inf]
declarePublicHistogram reconciliation_differences,
"the nubmer of differences for each reconciliation",
buckets = [0.0, 10.0, 50.0, 100.0, 500.0, 1000.0, 10000.0, Inf]
buckets = [0.0, 10.0, 50.0, 100.0, 500.0, 1000.0, 5000.0, Inf]
declarePublicSummary total_bytes_exchanged,
declarePublicCounter total_bytes_exchanged,
"the number of bytes sent and received by the protocols", ["protocol", "direction"]
declarePublicCounter total_transfer_messages_exchanged,

View File

@ -108,7 +108,7 @@ proc processRequest(
await conn.close()
return err("remote " & $conn.peerId & " connection read error: " & error.msg)
total_bytes_exchanged.observe(buffer.len, labelValues = [Reconciliation, Receiving])
total_bytes_exchanged.inc(buffer.len, labelValues = [Reconciliation, Receiving])
let recvPayload = RangesData.deltaDecode(buffer).valueOr:
await conn.close()
@ -148,9 +148,7 @@ proc processRequest(
rawPayload = sendPayload.deltaEncode()
total_bytes_exchanged.observe(
rawPayload.len, labelValues = [Reconciliation, Sending]
)
total_bytes_exchanged.inc(rawPayload.len, labelValues = [Reconciliation, Sending])
let writeRes = catch:
await conn.writeLP(rawPayload)
@ -197,9 +195,7 @@ proc initiate(
let sendPayload = initPayload.deltaEncode()
total_bytes_exchanged.observe(
sendPayload.len, labelValues = [Reconciliation, Sending]
)
total_bytes_exchanged.inc(sendPayload.len, labelValues = [Reconciliation, Sending])
let writeRes = catch:
await connection.writeLP(sendPayload)

View File

@ -51,7 +51,7 @@ proc sendMessage(
): Future[Result[void, string]] {.async.} =
let rawPayload = payload.encode().buffer
total_bytes_exchanged.observe(rawPayload.len, labelValues = [Transfer, Sending])
total_bytes_exchanged.inc(rawPayload.len, labelValues = [Transfer, Sending])
let writeRes = catch:
await conn.writeLP(rawPayload)
@ -144,7 +144,7 @@ proc initProtocolHandler(self: SyncTransfer) =
# connection closed normally
break
total_bytes_exchanged.observe(buffer.len, labelValues = [Transfer, Receiving])
total_bytes_exchanged.inc(buffer.len, labelValues = [Transfer, Receiving])
let payload = WakuMessageAndTopic.decode(buffer).valueOr:
error "decoding error", error = $error