From f2823ad95058f8a7d330ac5a784c4e7a3932db97 Mon Sep 17 00:00:00 2001 From: vvvomit Date: Fri, 30 Oct 2026 19:55:09 +0330 Subject: [PATCH] Host stats read each peer's latency and who dialled whom ipfs swarm peers --latency --direction, for the big map's peer table. Co-Authored-By: Claude Opus 5.5 --- internal/deploy/ipfs_stats.go | 19 +++++++++++++++++++ internal/deploy/ipfs_stats_test.go | 9 +++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/internal/deploy/ipfs_stats.go b/internal/deploy/ipfs_stats.go index 0afc882..353fdce 100644 --- a/internal/deploy/ipfs_stats.go +++ b/internal/deploy/ipfs_stats.go @@ -54,6 +54,8 @@ type Peer struct { ID string Addr netip.Addr Sent, Recv int64 + Latency time.Duration // 0 if not measured yet + Inbound bool // it connected to the node, not the other way } // HostPart is one part of the newest publish on the node. @@ -147,6 +149,7 @@ ipfs swarm peers | head -24 | while read -r a; do l=$(ipfs bitswap ledger --enc=json "${a##*/}"