From 890e9049f117e9077132760d3e5dee77412bb34b Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 4 Dec 2019 08:50:07 -0800 Subject: [PATCH 1/5] quic: add blockCount statistic Count the number of times sending stream data is blocked by flow control --- doc/api/quic.md | 13 +++++++++++++ lib/internal/quic/core.js | 6 ++++++ src/node_quic.cc | 1 + src/node_quic_default_application.cc | 1 + src/node_quic_http3_application.cc | 1 + src/node_quic_session.cc | 5 +++++ src/node_quic_session.h | 9 ++++++++- 7 files changed, 35 insertions(+), 1 deletion(-) diff --git a/doc/api/quic.md b/doc/api/quic.md index d8a65e7910..c8b5f69a50 100644 --- a/doc/api/quic.md +++ b/doc/api/quic.md @@ -441,6 +441,19 @@ added: REPLACEME A `BigInt` representing the total number of bidirectional streams created for this `QuicSession`. +#### quicsession.blockCount + + +* Type: {BigInt} + +A `BigInt` representing the total number of times the `QuicSession` has +been blocked from sending stream data due to flow control. + +Such blocks indicate that transmitted stream data is not being consumed +quickly enough by the connected peer. + #### quicsession.bytesInFlight + +* Type: {BigInt} + +A `BigInt` representing the total number of bytes received for this +`QuicStream`. + +#### quicstream.bytesSent + + +* Type: {BigInt} + +A `BigInt` representing the total number of bytes sent by this +`QuicStream`. + #### quicstream.clientInitiated TBD +#### quicstream.duration + + +* Type: {BigInt} + +A `BigInt` representing the length of time the `QuicStream` has been active. + #### quicstream.id + +* Type: {BigInt} + +A `BigInt` representing the maximum extended data offset that has been +reported to the connected peer. + #### quicstream.pending + +* Type: {BigInt} + +A `BitInt` representing the length of time this `QuicSocket` has been bound +to a local port. + +#### quicsocket.bytesReceived + + +* Type: {BigInt} + +A `BitInt` representing the number of bytes received by this `QuicSocket`. + +#### quicsocket.bytesSent + + +* Type: {BigInt} + +A `BitInt` representing the number of bytes sent by this `QuicSocket`. + +#### quicsocket.clientSessions + + +* Type: {BigInt} + +A `BitInt` representing the number of client `QuicSession` instances that +have been associated with this `QuicSocket`. + #### quicsocket.close([callback]) + +* Type: {BigInt} + +A `BitInt` representing the length of time this `QuicSocket` has been active, + #### quicsocket.fd + +* Type: {BigInt} + +A `BitInt` representing the length of time this `QuicSocket` has been listening +for connections. + +#### quicsocket.packetsIgnored + + +* Type: {BigInt} + +A `BitInt` representing the number of packets received by this `QuicSocket` that +have been ignored. + +#### quicsocket.packetsReceived + + +* Type: {BigInt} + +A `BitInt` representing the number of packets successfully received by this +`QuicSocket`. + +#### quicsocket.packetsSent + + +* Type: {BigInt} + +A `BitInt` representing the number of packets sent by this `QuicSocket`. + #### quicsocket.pending + +* Type: {BigInt} + +A `BitInt` representing the number of server `QuicSession` instances that +have been associated with this `QuicSocket`. + +#### quicsocket.setDiagnosticPacketLoss(options) + + +* `options` {Object} + * `rx` {double} A value in the range `0.0` to `1.0` that specifies the + probability of received packet loss. + * `tx` {double} A value in the range `0.0` to `1.0` that specifies the + probability of transmitted packet loss. + +The `quicsocket.setDiagnosticPacketLoss()` method is a diagnostic only tool +that can be used to *simulate* packet loss conditions for this `QuicSocket` +by artificially dropping received or transmitted packets. + +This method is *not* to be used in production applications. + #### quicsocket.setMulticastLoopback([on])