Skip to content

WebTransportSendGroup.getStats(): "aggregated stats" is not defined #802

Open

Description

@jesup

WebTransportSendGroup.getStats()
step 4.1 says:

Let gatheredStats be the list of aggregated stats from all streams in
streams needed to populate the dictionary members of
WebTransportSendStreamStats accurately.

"Aggregated" isn't defined, and a few things follow from that:

  1. Presumably each member of the result is the sum of that member across
    every stream in streams, but the spec doesn't say so.

  2. streams is "all WebTransportSendStreams whose [[SendGroup]] is this" at
    the time of the call, and [[SendGroup]] can be changed with the sendGroup
    setter. Moving a stream to another group (or to null) removes its bytes
    from this group's totals, so successive group results can go down. The
    WebTransportSendStreamStats members are each defined as "This number can
    only increase", which a group can't guarantee under that definition.
    Either the group result is allowed to decrease (and the spec should say
    so), or a group's counters should accumulate bytes written/sent/
    acknowledged while each stream was in the group, which means
    implementations have to attribute bytes to a group as they go.

  3. It isn't clear whether streams that have finished (closed, reset,
    aborted) still count, or whether a stream that has been garbage collected
    or whose transport has closed is still one "whose [[SendGroup]] is this".
    If they count, implementations need to retain each finished stream's
    final numbers for the life of the group.

  4. The WebTransportSendStreamStats member descriptions are written in terms
    of "this WebTransportSendStream"; reusing the dictionary for a group
    probably needs a sentence saying each member is the sum over the group.

  5. A note that a group result need not equal the sum of results from
    separate per-stream getStats() calls would help test authors:
    bytesSent and bytesAcknowledged advance between calls, so only
    group >= sum-of-earlier-member-readings holds.

Suggested text for step 4.1:

Let gatheredStats be the list of stats needed to populate the dictionary
members of WebTransportSendStreamStats, where each member is the sum of
that member's value over all streams in streams.

plus a resolution of (2) and (3). Firefox currently sums over the current
members, and keeps the final numbers of members that were still in the group
when the transport was cleaned up, so a group's totals don't drop to zero
when the session ends.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions