Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

quic: additional statistics updates #213

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 167 additions & 3 deletions doc/api/quic.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const { createSocket } = require('quic');
// Create a QuicSocket associated with localhost and port 1234
const socket = createSocket({ port: 1234 });

const client = client.connect({
const client = socket.connect({
address: 'example.com',
port: 4567,
alpn: 'foo'
Expand All @@ -131,7 +131,7 @@ New instance of `QuicServerSession` are created internally by the
`QuicSocket` if it has been configured to listen for new connections
using the `listen()` method.

```
```js
const key = getTLSKeySomehow();
const cert = getTLSCertSomehow();

Expand Down Expand Up @@ -405,7 +405,6 @@ added: REPLACEME
An object containing the local address information for the `QuicSocket` to which
the `QuicSession` is currently associated.


#### quicsession.alpnProtocol
<!-- YAML
added: REPLACEME
Expand Down Expand Up @@ -441,6 +440,19 @@ added: REPLACEME
A `BigInt` representing the total number of bidirectional streams
created for this `QuicSession`.

#### quicsession.blockCount
<!-- YAML
added: REPLACEME
-->

* 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
<!-- YAML
added: REPLACEME
Expand Down Expand Up @@ -1015,6 +1027,44 @@ added: REPLACEME
Will be `true` if the `QuicSocket` has been successfully bound to the local UDP
port.

#### quicsocket.boundDuration
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BitInt` representing the length of time this `QuicSocket` has been bound
to a local port.

#### quicsocket.bytesReceived
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BitInt` representing the number of bytes received by this `QuicSocket`.

#### quicsocket.bytesSent
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BitInt` representing the number of bytes sent by this `QuicSocket`.

#### quicsocket.clientSessions
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BitInt` representing the number of client `QuicSession` instances that
have been associated with this `QuicSocket`.

#### quicsocket.close([callback])
<!-- YAML
added: REPLACEME
Expand Down Expand Up @@ -1187,6 +1237,15 @@ never have reason to call this.
If `multicastInterface` is not specified, the operating system will attempt to
drop membership on all valid interfaces.

#### quicsocket.duration
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BitInt` representing the length of time this `QuicSocket` has been active,

#### quicsocket.fd
<!-- YAML
added: REPLACEME
Expand Down Expand Up @@ -1308,6 +1367,45 @@ Listen for new peer-initiated sessions.
If a `callback` is given, it is registered as a handler for the
`'session'` event.

#### quicsocket.listenDuration
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BitInt` representing the length of time this `QuicSocket` has been listening
for connections.

#### quicsocket.packetsIgnored
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BitInt` representing the number of packets received by this `QuicSocket` that
have been ignored.

#### quicsocket.packetsReceived
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BitInt` representing the number of packets successfully received by this
`QuicSocket`.

#### quicsocket.packetsSent
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BitInt` representing the number of packets sent by this `QuicSocket`.

#### quicsocket.pending
<!-- YAML
added: REPLACEME
Expand All @@ -1332,6 +1430,33 @@ added: REPLACEME
Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP
packets may be sent to a local interface's broadcast address.

#### quicsocket.serverSessions
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BitInt` representing the number of server `QuicSession` instances that
have been associated with this `QuicSocket`.

#### quicsocket.setDiagnosticPacketLoss(options)
<!-- YAML-
added: REPLACEME
-->

* `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])
<!-- YAML
added: REPLACEME
Expand Down Expand Up @@ -1615,6 +1740,26 @@ added: REPLACEME

Set to `true` if the `QuicStream` is bidirectional.

#### quicstream.bytesReceived
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BigInt` representing the total number of bytes received for this
`QuicStream`.

#### quicstream.bytesSent
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BigInt` representing the total number of bytes sent by this
`QuicStream`.

#### quicstream.clientInitiated
<!-- YAML
added: REPLACEME
Expand Down Expand Up @@ -1654,6 +1799,15 @@ added: REPLACEME
-->
TBD

#### quicstream.duration
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BigInt` representing the length of time the `QuicStream` has been active.

#### quicstream.id
<!-- YAML
added: REPLACEME
Expand All @@ -1663,6 +1817,16 @@ added: REPLACEME

The numeric identifier of the `QuicStream`.

#### quicstream.maxExtendedOffset
<!-- YAML
added: REPLACEME
-->

* Type: {BigInt}

A `BigInt` representing the maximum extended data offset that has been
reported to the connected peer.

#### quicstream.pending
<!-- YAML
added: REPLACEME
Expand Down
Loading