feat(api): add unscoped_relay_count_24h per-node field (#1823)

## What
Adds a per-node API field `unscoped_relay_count_24h` on repeater/room
nodes: the
  number of the node's 24h relay-hops that were unscoped floods
  (route_type == ROUTE_TYPE_FLOOD). A strict subset of relay_count_24h.

  ## Why
A well-configured repeater runs `flood.max.unscoped 0` and should not
rebroadcast
unscoped floods — each one is re-sent by every repeater that hears it,
so one
packet turns into mesh-wide traffic. Exposing this lets clients (the
ArcScope
repeater advisor) detect and flag that base-config problem from observed
packets.

  ## How
Computed like relay_count_24h in both paths (bulk /api/nodes + per-node
detail)
with a route_type==FLOOD filter; reuses the byPathHop index, no
migration. Wired
  into both handlers + OpenAPI schema + unit tests (per-node and bulk).

Co-authored-by: Waydroid Builder <build@waydroid.local>
This commit is contained in:
Michael J. Arcan
2026-07-07 09:12:44 +02:00
committed by GitHub
parent ba68069c23
commit bd0a58e14c
6 changed files with 104 additions and 2 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ func TestOpenAPINodeSchema_Metrics(t *testing.T) {
}
// Relay-activity fields are documented too.
for _, field := range []string{"relay_active", "relay_count_1h", "relay_count_24h", "last_relayed"} {
for _, field := range []string{"relay_active", "relay_count_1h", "relay_count_24h", "unscoped_relay_count_24h", "last_relayed"} {
if _, ok := props[field]; !ok {
t.Errorf("Node.properties.%s missing", field)
}