1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-24 04:01:07 +03:00

Add network path model update events to qlog

Summary: Several "Network Path Model" parameters are described in Sec. 2.9 of the BBRv2 IETF draft. These quantities evolve throughout the connection and they are useful to analyze BBRv2 performance. This diff adds inflight_hi, inflight_lo, bandwidth_hi, and bandwidth_lo to the qlog.

Reviewed By: mjoras

Differential Revision: D61414936

fbshipit-source-id: 2862db2a6aab336fd8a60e4ae5b358e9ab5588b4
This commit is contained in:
Riten Gupta
2024-08-26 14:07:23 -07:00
committed by Facebook GitHub Bot
parent 93bb817940
commit 5f74df10b6
7 changed files with 111 additions and 3 deletions

View File

@@ -982,6 +982,40 @@ folly::dynamic QLogL4sWeightUpdateEvent::toDynamic() const {
return d;
}
QLogNetworkPathModelUpdateEvent::QLogNetworkPathModelUpdateEvent(
uint64_t inflightHi,
uint64_t inflightLo,
uint64_t bandwidthHiBytes,
std::chrono::microseconds bandwidthHiInterval,
uint64_t bandwidthLoBytes,
std::chrono::microseconds bandwidthLoInterval,
std::chrono::microseconds refTimeIn)
: inflightHi_(inflightHi),
inflightLo_(inflightLo),
bandwidthHiBytes_(bandwidthHiBytes),
bandwidthHiInterval_(bandwidthHiInterval),
bandwidthLoBytes_(bandwidthLoBytes),
bandwidthLoInterval_(bandwidthLoInterval) {
eventType = QLogEventType::NetworkPathModelUpdate;
refTime = refTimeIn;
}
folly::dynamic QLogNetworkPathModelUpdateEvent::toDynamic() const {
folly::dynamic d = folly::dynamic::array(
folly::to<std::string>(refTime.count()),
"metric_update",
toString(eventType));
folly::dynamic data = folly::dynamic::object();
data["inflight_hi"] = inflightHi_;
data["inflight_lo"] = inflightLo_;
data["bandwidth_hi_bytes"] = bandwidthHiBytes_;
data["bandwidth_hi_interval"] = bandwidthHiInterval_.count();
data["bandwidth_lo_bytes"] = bandwidthLoBytes_;
data["bandwidth_lo_interval"] = bandwidthLoInterval_.count();
d.push_back(std::move(data));
return d;
}
folly::StringPiece toString(QLogEventType type) {
switch (type) {
case QLogEventType::PacketSent:
@@ -1030,6 +1064,8 @@ folly::StringPiece toString(QLogEventType type) {
return "priority";
case QLogEventType::L4sWeightUpdate:
return "l4s_weight_update";
case QLogEventType::NetworkPathModelUpdate:
return "network_path_model_update";
}
folly::assume_unreachable();
}