1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-09 10:00:57 +03:00

HTTP Priority update logging in QLog

Summary: as title

Reviewed By: mjoras

Differential Revision: D24903759

fbshipit-source-id: 39127b658e6cb06025272c1c5ab0f7de2ae1a54a
This commit is contained in:
Yang Chi
2020-11-17 20:20:10 -08:00
committed by Facebook GitHub Bot
parent 218873a107
commit 7c85871c3e
7 changed files with 66 additions and 1 deletions

View File

@@ -839,6 +839,28 @@ folly::dynamic QLogPathValidationEvent::toDynamic() const {
return d;
}
QLogPriorityUpdateEvent::QLogPriorityUpdateEvent(
StreamId streamId,
uint8_t urgency,
bool incremental,
std::chrono::microseconds refTimeIn)
: streamId_(streamId), urgency_(urgency), incremental_(incremental) {
eventType = QLogEventType::PriorityUpdate;
refTime = refTimeIn;
}
folly::dynamic QLogPriorityUpdateEvent::toDynamic() const {
folly::dynamic d = folly::dynamic::array(
folly::to<std::string>(refTime.count()), "HTTP3", toString(eventType));
folly::dynamic data = folly::dynamic::object();
data["id"] = streamId_;
data["urgency"] = urgency_;
data["incremental"] = incremental_;
d.push_back(std::move(data));
return d;
}
folly::StringPiece toString(QLogEventType type) {
switch (type) {
case QLogEventType::PacketSent:
@@ -883,6 +905,8 @@ folly::StringPiece toString(QLogEventType type) {
return "connection_migration";
case QLogEventType::PathValidation:
return "path_validation";
case QLogEventType::PriorityUpdate:
return "priority";
}
folly::assume_unreachable();
}