mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-09 10:00:57 +03:00
Summary: Implement datagramReceived interface, as part of [spec](fburl.com/proxygen-qlog). Reviewed By: sharma95 Differential Revision: D16270834 fbshipit-source-id: fc112600b7d72a3ffdbb3b88584b2e17ed9c1ce1
66 lines
2.1 KiB
C++
66 lines
2.1 KiB
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <folly/dynamic.h>
|
|
#include <quic/codec/Types.h>
|
|
#include <quic/logging/QLogger.h>
|
|
#include <quic/logging/QLoggerConstants.h>
|
|
#include <quic/logging/QLoggerTypes.h>
|
|
|
|
namespace quic {
|
|
|
|
class FileQLogger : public QLogger {
|
|
public:
|
|
std::vector<std::unique_ptr<QLogEvent>> logs;
|
|
FileQLogger(std::string protocolTypeIn = kHTTP3ProtocolType.str()) {
|
|
protocolType = std::move(protocolTypeIn);
|
|
}
|
|
~FileQLogger() override = default;
|
|
void addPacket(const RegularQuicPacket& regularPacket, uint64_t packetSize)
|
|
override;
|
|
void addPacket(
|
|
const VersionNegotiationPacket& versionPacket,
|
|
uint64_t packetSize,
|
|
bool isPacketRecvd) override;
|
|
void addPacket(const RegularQuicWritePacket& writePacket, uint64_t packetSize)
|
|
override;
|
|
void addConnectionClose(
|
|
std::string error,
|
|
std::string reason,
|
|
bool drainConnection,
|
|
bool sendCloseImmediately) override;
|
|
void addTransportSummary(
|
|
uint64_t totalBytesSent,
|
|
uint64_t totalBytesRecvd,
|
|
uint64_t sumCurWriteOffset,
|
|
uint64_t sumMaxObservedOffset,
|
|
uint64_t sumCurStreamBufferLen,
|
|
uint64_t totalBytesRetransmitted,
|
|
uint64_t totalStreamBytesCloned,
|
|
uint64_t totalBytesCloned,
|
|
uint64_t totalCryptoDataWritten,
|
|
uint64_t totalCryptoDataRecvd) override;
|
|
void addCongestionMetricUpdate(
|
|
uint64_t bytesInFlight,
|
|
uint64_t currentCwnd,
|
|
std::string congestionEvent,
|
|
std::string state = "",
|
|
std::string recoveryState = "") override;
|
|
void addPacingMetricUpdate(
|
|
uint64_t pacingBurstSizeIn,
|
|
std::chrono::microseconds pacingIntervalIn) override;
|
|
void addAppIdleUpdate(std::string idleEvent, bool idle) override;
|
|
void addPacketDrop(size_t packetSize, std::string dropReasonIn) override;
|
|
void addDatagramReceived(uint64_t dataLen) override;
|
|
void outputLogsToFile(const std::string& path, bool prettyJson);
|
|
folly::dynamic toDynamic() const;
|
|
};
|
|
} // namespace quic
|