mirror of
https://github.com/ton-blockchain/ton
synced 2025-02-12 19:22:37 +00:00
23 lines
514 B
C++
23 lines
514 B
C++
#pragma once
|
|
|
|
#include "td/utils/Time.h"
|
|
#include "td/utils/TimedStat.h"
|
|
|
|
namespace ton {
|
|
namespace rldp2 {
|
|
struct RttStats {
|
|
void on_rtt_sample(double rtt_sample, double ack_delay, td::Timestamp now);
|
|
|
|
double min_rtt = -1;
|
|
double windowed_min_rtt = -1;
|
|
double last_rtt = -1;
|
|
double smoothed_rtt = -1;
|
|
double rtt_var = -1;
|
|
td::uint32 rtt_round{0};
|
|
|
|
private:
|
|
td::Timestamp rtt_round_at;
|
|
td::TimedStat<td::MinStat<double>> windowed_min_rtt_stat{5, 0};
|
|
};
|
|
} // namespace rldp2
|
|
} // namespace ton
|