mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-08-09 20:42:44 +03:00
QuicConnectionStats type change from string to the "native"
Reviewed By: lnicco Differential Revision: D26379617 fbshipit-source-id: 308d53ca86c2a2e774e3618038eece7091482ed8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ba71671bb2
commit
b1a364b9dd
@@ -2737,20 +2737,16 @@ QuicConnectionStats QuicTransportBase::getConnectionsStats() const {
|
||||
if (!conn_) {
|
||||
return connStats;
|
||||
}
|
||||
connStats.peerAddress = conn_->peerAddress.describe();
|
||||
connStats.peerAddress = conn_->peerAddress;
|
||||
connStats.duration = Clock::now() - conn_->connectionTime;
|
||||
if (conn_->congestionController) {
|
||||
connStats.cwnd_bytes = conn_->congestionController->getCongestionWindow();
|
||||
connStats.congestionController =
|
||||
congestionControlTypeToString(conn_->congestionController->type())
|
||||
.str();
|
||||
connStats.congestionController = conn_->congestionController->type();
|
||||
conn_->congestionController->getStats(connStats.congestionControllerStats);
|
||||
}
|
||||
connStats.ptoCount = conn_->lossState.ptoCount;
|
||||
connStats.srtt = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
conn_->lossState.srtt);
|
||||
connStats.rttvar = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
conn_->lossState.rttvar);
|
||||
connStats.srtt = conn_->lossState.srtt;
|
||||
connStats.rttvar = conn_->lossState.rttvar;
|
||||
connStats.peerAckDelayExponent = conn_->peerAckDelayExponent;
|
||||
connStats.udpSendPacketLen = conn_->udpSendPacketLen;
|
||||
if (conn_->streamManager) {
|
||||
|
@@ -3659,7 +3659,7 @@ TEST_F(
|
||||
|
||||
TEST_F(QuicTransportImplTest, GetConnectionStatsSmoke) {
|
||||
auto stats = transport->getConnectionsStats();
|
||||
EXPECT_EQ(stats.congestionController, kCongestionControlCubicStr);
|
||||
EXPECT_EQ(stats.congestionController, CongestionControlType::Cubic);
|
||||
EXPECT_EQ(stats.clientConnectionId, "0a090807");
|
||||
}
|
||||
|
||||
|
@@ -707,6 +707,7 @@ void Cubic::onPacketAckedInRecovery(const AckEvent& ack) {
|
||||
|
||||
void Cubic::getStats(CongestionControllerStats& stats) const {
|
||||
stats.cubicStats.state = static_cast<uint8_t>(state_);
|
||||
stats.cubicStats.ssthresh = ssthresh_;
|
||||
}
|
||||
|
||||
folly::StringPiece cubicStateToString(CubicStates state) {
|
||||
|
@@ -642,7 +642,7 @@ void QuicServerTransport::registerAllTransportKnobParamHandlers() {
|
||||
QuicConnectionStats QuicServerTransport::getConnectionsStats() const {
|
||||
QuicConnectionStats connStats = QuicTransportBase::getConnectionsStats();
|
||||
if (serverConn_) {
|
||||
connStats.localAddress = serverConn_->serverAddr.describe();
|
||||
connStats.localAddress = serverConn_->serverAddr;
|
||||
}
|
||||
return connStats;
|
||||
}
|
||||
|
@@ -8,9 +8,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <folly/SocketAddress.h>
|
||||
#include <chrono>
|
||||
#include <string>
|
||||
|
||||
#include <quic/QuicConstants.h>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
namespace quic {
|
||||
@@ -26,6 +29,7 @@ struct CopaStats {
|
||||
|
||||
struct CubicStats {
|
||||
uint8_t state;
|
||||
uint64_t ssthresh;
|
||||
};
|
||||
|
||||
union CongestionControllerStats {
|
||||
@@ -37,15 +41,15 @@ union CongestionControllerStats {
|
||||
struct QuicConnectionStats {
|
||||
uint8_t workerID{0};
|
||||
uint32_t numConnIDs{0};
|
||||
std::string localAddress;
|
||||
std::string peerAddress;
|
||||
folly::SocketAddress localAddress;
|
||||
folly::SocketAddress peerAddress;
|
||||
std::chrono::duration<float> duration{0};
|
||||
uint64_t cwnd_bytes{0};
|
||||
std::string congestionController;
|
||||
CongestionControlType congestionController;
|
||||
CongestionControllerStats congestionControllerStats;
|
||||
uint32_t ptoCount{0};
|
||||
std::chrono::duration<float> srtt{0ms};
|
||||
std::chrono::duration<float> rttvar{0ms};
|
||||
std::chrono::microseconds srtt{0us};
|
||||
std::chrono::microseconds rttvar{0us};
|
||||
uint64_t peerAckDelayExponent{0};
|
||||
uint64_t udpSendPacketLen{0};
|
||||
uint64_t numStreams{0};
|
||||
|
Reference in New Issue
Block a user