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

贡献者指南