dotnet/runtime

Monitoring QUIC/HTTP3 read and written bytes

Open

#84 093 ouverte le 29 mars 2023

Voir sur GitHub
 (8 commentaires) (0 réactions) (0 assignés)C# (5 445 forks)batch import
area-System.Net.Quichelp wanted

Métriques du dépôt

Stars
 (17 886 stars)
Métriques de merge PR
 (Merge moyen 12j 11h) (661 PRs mergées en 30 j)

Description

Background and motivation

I am looking for a reasonable way to monitor traffic (number of bytes received) on HTTP requests including HTTP/3.

I found a previous issue https://github.com/dotnet/runtime/issues/41949 that allows to use a custom stream implementation for H2

However, I don't see that being viable for QuicConnetions and H3.

What I would prefer is something similar as described in https://github.com/dotnet/runtime/issues/31003 by @karelz using monitoring.

However, the ReadAsync only seems to monitor the size of the buffer where the data is read into, but not the actual size of the received data:

if (NetEventSource.Log.IsEnabled())
{
    NetEventSource.Info(this, $"{this} Stream reading into memory of '{buffer.Length}' bytes.");
}

Is there an alternative approach to access this data?

API Proposal

I would be happy to use EventListener to collect the described data.

Ideally the event payload could store the size of the data without formatting it to string message.

API Usage

No new public API would be required.

Alternative Designs

No response

Risks

No response

Guide contributeur