WebTransportSendGroup.getStats(): "aggregated stats" is not defined #802
Description
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:
-
Presumably each member of the result is the sum of that member across
every stream in streams, but the spec doesn't say so. -
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. -
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. -
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. -
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