New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per-stream stats #372
Comments
Per-stream stats: 👍 These specific ones:
We can attribute byte counts to streams, but that would involve counting of frames. Counting frames is not that interesting because framing choices aren't necessarily interesting to an application. For example, under some conditions, Firefox will put two frames for the same stream into the same packet. Don't ask why, I'm not interesting in spending the time to write up the way that our implementation works in enough detail for that to be understood, just know that the specification doesn't constrain implementations and there are sometimes good reasons for using that. The number of packets into which frames are placed is not interesting either. Nor is it directly related to anything of consequence. Stats that I would include are related to the bytes of the stream. At the sender:
Note that you can capture some of the overhead and retransmission stuff in the difference between "sent" and "acknowledged" counts if you allow the "sent" statistic to capture overheads. You could split the "sent" statistic into counts for the offset into the stream into which you have sent stuff (a progress counter if you like) as opposed to a count of how many bytes hit the network. At the receiver:
You could maybe include bytes acknowledged as a separate item here, but it doesn't add much value as you expect the stack to acknowledge promptly. |
I realize in looking at this again that - at the receiver - tracking the received bytes is fiddly. It is easy to track the maximum offset into the stream that has been received, but annoying to count the number of bytes that have been received. If there are gaps in what you receive, you have to walk through all the gaps, which is annoying. You can also count the number of bytes received without accounting for redundancy (if you receive the first byte multiple times, you can count it each time), but I'm not sure that that is useful information. |
Meeting:
|
Here's my bikeshed attempt at pulling @martinthomson's #372 (comment) into a concrete proposal. dictionary WebTransportSendStreamStats {
DOMHighResTimeStamp timestamp;
unsigned long long bytesWritten;
unsigned long long bytesSentProgress;
unsigned long long bytesSentAndAcknowledged;
unsigned long long networkBytesSent;
};
dictionary WebTransportReceiveStreamStats {
DOMHighResTimeStamp timestamp;
unsigned long long bytesReceivedProgress;
unsigned long long bytesRead;
unsigned long long networkBytesReceived;
}; If you can't tell which is which of the members, then I've failed. bytesWritten >= bytesSentProgress >= bytesSentAndAcknowledged (Read backwards as "can't be more than") |
Maybe consider s/bytesPassedIn/bytesWritten/ and s/bytesHandedOut/bytesRead/. Both of the networkBytes* options might be difficult to understand without a bunch more documentation. For instance, it's not clear from the name what layer those bytes are measured. STREAM frames (maybe OK as a measure), QUIC packets (very tricky), UDP datagrams, IP packets, Ethernet frames? You will need to be careful about how you convey this for TCP-based WebTransport - if the goal is to account for any retransmission or redundancy that might be involved in getting the bytes out there, we don't get visibility into TCP retransmission logic in the same way that a QUIC stack might. |
Winner. Let me edit my comment above immediately.
From my perspective, it's whatever health metric we decide to expose that isn't a stream progress counter. Happy to bikeshed. |
For "networkBytes" I was trying to get at what you wanted to measure first. Naming follows that decision. If this is a count of the number of bytes of QUIC frames (or HTTP/2 frames) that were sent or received, then we might have a metric that can be produced. The other metrics are far less possible. I also wanted to caution that QUIC and HTTP/2 will behave very differently here; we'd want to be comfortable with that. |
Meeting:
|
New bikeshed iteration: dictionary WebTransportSendStreamStats {
DOMHighResTimeStamp timestamp;
unsigned long long amountWrittenTo;
unsigned long long sentProgress;
unsigned long long acknowledgedProgress;
};
dictionary WebTransportReceiveStreamStats {
DOMHighResTimeStamp timestamp;
unsigned long long amountReadFrom;
unsigned long long receivedProgress;
}; They're all stream progress counters, in bytes, which is what the API streams vend. By intentionally avoiding "bytes" in the names however, my hope is to avoid confusion over what layer "bytes" are measured at (we don't expose any deeper measurements of underlying network traffic at this level). amountWrittenTo >= sentProgress >= acknowledgedProgress |
Meeting:
|
Meeting:
|
At TPAC I proposed per-stream stats. Discuss.
If
stream
is readable,stats
would beIf
stream
is writable,stats
would beWe could reuse this for datagrams:
The text was updated successfully, but these errors were encountered: