diff --git a/demo/web/src/stats.html b/demo/web/src/stats.html index 132e6102a96..22f06bab7ae 100644 --- a/demo/web/src/stats.html +++ b/demo/web/src/stats.html @@ -116,8 +116,8 @@

Viewers no viewers
-

Sessions · by auth root

-
no sessions
+

Sessions · by stats label

+
no sessions
diff --git a/demo/web/src/stats.ts b/demo/web/src/stats.ts index 422d3b4c1ab..c912cc70c54 100644 --- a/demo/web/src/stats.ts +++ b/demo/web/src/stats.ts @@ -11,7 +11,7 @@ * Per-node tracks we read: * publisher.json egress (relay -> downstream viewers) * subscriber.json ingress (upstream publishers -> relay) - * sessions.json sessions by auth root + * sessions.json sessions by stats label * * Each frame is `{ "": Snapshot }`. Counters are cumulative; * "active" = started - ended. The relay includes every entry it still holds @@ -525,15 +525,15 @@ ui.run((effect) => { }; }); - // Sessions connected under each auth root, counted regardless of data flow. + // Sessions connected under each stats label, counted regardless of data flow. const sessionRows = Object.keys(stats.sessions) .sort() - .map((root) => { - const s = stats.sessions[root] ?? {}; + .map((label) => { + const s = stats.sessions[label] ?? {}; return { - key: root, + key: label, cells: [ - root || "(none)", + label || "(none)", String(active(sessionsStarted(s), sessionsEnded(s))), String(sessionsStarted(s)), ], @@ -550,7 +550,7 @@ ui.run((effect) => { ["broadcast", "viewers", "tracks", "egress", "frames", "groups", "datagrams", "fetches", "announce"], egressRows(stats.egress), ); - renderTable($("node-session-roots"), ["auth root", "connected", "total"], sessionRows); + renderTable($("node-session-labels"), ["label", "connected", "total"], sessionRows); const sessions = countSessions(stats.sessions); $("node-sessions").textContent = `${sessions} session${sessions === 1 ? "" : "s"}`; diff --git a/doc/bin/inspect.md b/doc/bin/inspect.md index f46c49ecc85..7acd57a099c 100644 --- a/doc/bin/inspect.md +++ b/doc/bin/inspect.md @@ -76,8 +76,8 @@ curl http://localhost:4443/fetch/.stats/node/local/host/publisher.json | jq The node name (`local/host` here) is `stats.node`. Each fetch returns the newest snapshot of cumulative counters. `totals.json` sums each tier's traffic and sessions, `publisher.json` is egress per broadcast path, -`subscriber.json` is ingress, and `sessions.json` counts sessions per auth -root. A subscriber may also ask for `/traffic.json`, one broadcast +`subscriber.json` is ingress, and `sessions.json` counts sessions per stats +label. A subscriber may also ask for `/traffic.json`, one broadcast prefix rolled up with each child, produced only while held. Fetch twice and divide by the interval for a rate. The `.json.z` twins carry compressed patches, which these tools print as raw bytes. [Stats](/concept/stats) describes every field. diff --git a/doc/bin/relay/auth.md b/doc/bin/relay/auth.md index 9ec90779a2e..1b1c48e0928 100644 --- a/doc/bin/relay/auth.md +++ b/doc/bin/relay/auth.md @@ -28,7 +28,7 @@ token, the declared role, and the verified client certificate. Nothing is parsed on the server's behalf: the `jwt` query parameter is a convention of `moq auth serve`, not of the relay. The grant answers with `publish` and `subscribe` pattern unions and optionally a `root` alias, read-only `mounts`, -`expires`, a `revalidate` cadence, a stats `tier`, and `peer` / `upstream` to +`expires`, a `revalidate` cadence, a stats `tier` and `label`, and `peer` / `upstream` to mark another relay and an [upstream link](/bin/relay/cluster#upstream-links). The fields are documented on `moq_auth::Request` and `moq_auth::Grant` ([Rust](/lib/rs/moq-auth), [TypeScript](/lib/js/auth)). @@ -52,8 +52,8 @@ flowing. A wider grant brings those paths back within the admitted root and SETUP role. A one-shot HTTP `/fetch` ends on a narrower grant instead. A changed `root`, `mounts`, `peer`, or `upstream`, or a 401 or 403, ends that credential's grant, which closes the session unless an -[in-band](#in-band-renewal) credential still holds it. A changed `tier` keeps -the session and moves its stats from then on. Any other failure retries with backoff and the session lives +[in-band](#in-band-renewal) credential still holds it. A changed `tier` or +`label` keeps the session and moves its later stats. Any other failure retries with backoff and the session lives until `expires`, so an outage always has the bound the server chose. A grant with `revalidate` must set `expires` for that reason. A session that reaches `expires` closes as `Expired` rather than `Unauthorized`, which also diff --git a/doc/bin/relay/config.md b/doc/bin/relay/config.md index 31579b68835..70d96a50846 100644 --- a/doc/bin/relay/config.md +++ b/doc/bin/relay/config.md @@ -316,7 +316,7 @@ relay dials and LAN peers it admits), which is what makes billing per customer o Each run, and each group returning after its linger, announces under a fresh [epoch](/concept/moq-lite#publisher-epochs), so a restart is a new broadcast at the same path. Each group's totals count everything since its epoch began, so -billing reads those; per-path traffic and per-root sessions and HTTP requests are for +billing reads those; per-path traffic and per-label sessions and HTTP requests are for dashboards. Session counters report how close sessions come to the per-session limits, past which one is closed with `TOO_MANY_REQUESTS`. [Stats](/concept/stats) describes the paths, tracks, and encodings; read them diff --git a/doc/concept/stats.md b/doc/concept/stats.md index 33e4a1a1301..52a82d2e233 100644 --- a/doc/concept/stats.md +++ b/doc/concept/stats.md @@ -51,7 +51,7 @@ generate more stats. - `` tells relays sharing a cluster apart. It may span several segments (`sjc/1`), and is omitted along with its slash when unset: `/node`. - `` is the first `depth` segments of each broadcast path (for traffic) - or auth root (for sessions), so a consumer can scope an announce to one + or stats label (for sessions), so a consumer can scope an announce to one tenant. A path shorter than `depth` groups under all of its segments. - The literal `node` segment leaves room for sibling categories under the same prefix, so a consumer skips any path without `node` where it expects one. A @@ -89,8 +89,8 @@ comes in two encodings: | `totals.json` | tier | [Totals](#totals) for the whole group | | `[/]publisher.json` | broadcast path | [Traffic](#traffic) this node sent (egress) | | `[/]subscriber.json` | broadcast path | [Traffic](#traffic) this node received (ingress) | -| `[/]sessions.json` | auth root | [Sessions](#sessions) connected now | -| `[/]presence.json` | tier | [Sessions](#sessions) under one auth root | +| `[/]sessions.json` | stats label | [Sessions](#sessions) connected now | +| `[