mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-24 04:01:07 +03:00
Add new qlog type for l4s weight updates
Summary: This helps with tuning l4s reaction in Cubic and debugging l4s in general. To avoid spamming the qlog, an l4s weights update is only logged if new CE marks are echoed from the peer. Reviewed By: sharmafb Differential Revision: D57874704 fbshipit-source-id: 9c3f139aec73fc0dbd8d38e2237d6a6478cf1e3d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
05b4eb9238
commit
1ad1b0789b
@@ -957,6 +957,31 @@ folly::dynamic QLogPriorityUpdateEvent::toDynamic() const {
|
||||
return d;
|
||||
}
|
||||
|
||||
QLogL4sWeightUpdateEvent::QLogL4sWeightUpdateEvent(
|
||||
double l4sWeightIn,
|
||||
uint32_t newECT1EchoedIn,
|
||||
uint32_t newCEEchoedIn,
|
||||
std::chrono::microseconds refTimeIn)
|
||||
: l4sWeight_(l4sWeightIn),
|
||||
newECT1Echoed_(newECT1EchoedIn),
|
||||
newCEEchoed_(newCEEchoedIn) {
|
||||
eventType = QLogEventType::L4sWeightUpdate;
|
||||
refTime = refTimeIn;
|
||||
}
|
||||
|
||||
folly::dynamic QLogL4sWeightUpdateEvent::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["weight"] = l4sWeight_;
|
||||
data["new_ect1"] = newECT1Echoed_;
|
||||
data["new_ce"] = newCEEchoed_;
|
||||
d.push_back(std::move(data));
|
||||
return d;
|
||||
}
|
||||
|
||||
folly::StringPiece toString(QLogEventType type) {
|
||||
switch (type) {
|
||||
case QLogEventType::PacketSent:
|
||||
@@ -1003,6 +1028,8 @@ folly::StringPiece toString(QLogEventType type) {
|
||||
return "path_validation";
|
||||
case QLogEventType::PriorityUpdate:
|
||||
return "priority";
|
||||
case QLogEventType::L4sWeightUpdate:
|
||||
return "l4s_weight_update";
|
||||
}
|
||||
folly::assume_unreachable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user