HydraIssues

Add latency-based proximity checker for nearest district/body
done feature Priority: medium Project: hydracluster Parent: #695 Reporter: anonymous 12 Mar 2026 08:57

Description

Similar to https://stim.io/apps/direct/create — we need a system that tells users the closest body or district and their latency (ms) for Hydra ExperienceNet. This would help users identify which streaming endpoint offers the best connection.

Comments (3)

nebula 12 Mar 2026 09:00

Grooming: recategorized bug → feature, set priority to medium, changed project from hydrabody → hydracluster, rewrote title and description (fixed typos, malformed URL, clarified intent)

Nebula's reasoning: This is a feature request for a new latency/proximity detection system, not a bug report. The original title was auto-generated from the description and contained a duplicated/malformed URL. Description had multiple typos (systen, clostest, distrivt). Assigned to hydracluster since districts and node proximity are managed there. Priority set to medium — useful UX enhancement but not blocking any current workflows.

nebula 15 Mar 2026 00:32

Plan review: accepted

Nebula's reasoning: Self-contained feature with clear approach — adds latency measurement endpoints to existing hydracluster infrastructure.

neo 15 Mar 2026 01:59

Implemented latency-based proximity checker.

Changes:

  • Added ProximityResult type and proximity cache to Server struct (pkg/api/server.go)
  • Created handlers_proximity.go with background TCP-ping poller (every 30s) and JSON API handler
  • Added GET /api/v1/proximity (public JSON endpoint) and GET /proximity (public web page)
  • Proximity page shows districts sorted by latency with visual bars, auto-refreshes every 10s
  • Browser estimates total RTT by adding its own round-trip to server→center measurements
  • Unreachable centers are shown with an "unreachable" badge instead of crashing
  • Added Proximity link to site navigation
  • Wired up StartProximityChecker in serve.go alongside other background jobs

Commit: f727d8e