dotnet/runtime

Monitoring QUIC/HTTP3 read and written bytes

Open

#84,093 建立於 2023年3月29日

在 GitHub 查看
 (8 留言) (0 反應) (0 負責人)C# (5,445 fork)batch import
area-System.Net.Quichelp wanted

倉庫指標

Star
 (17,886 star)
PR 合併指標
 (平均合併 12天 11小時) (30 天內合併 661 個 PR)

描述

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

貢獻者指南