From eaaff7fa111c821ed6710dec7b6c49c5ecac6ad4 Mon Sep 17 00:00:00 2001 From: michele papalini Date: Thu, 3 Oct 2019 12:09:01 +0200 Subject: [HICN-291] handle multiple paths in RTC Change-Id: I69d331aa6e953e802e2f4b3e60325f852941fd94 Signed-off-by: michele papalini --- .../src/hicn/transport/protocols/statistics.h | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'libtransport/src/hicn/transport/protocols/statistics.h') diff --git a/libtransport/src/hicn/transport/protocols/statistics.h b/libtransport/src/hicn/transport/protocols/statistics.h index 47d164158..d5e89b96d 100644 --- a/libtransport/src/hicn/transport/protocols/statistics.h +++ b/libtransport/src/hicn/transport/protocols/statistics.h @@ -33,7 +33,9 @@ class TransportStatistics { average_rtt_(0), avg_window_size_(0), interest_tx_(0), - alpha_(alpha) {} + alpha_(alpha), + loss_ratio_(0.0), + queuing_delay_(0.0) {} TRANSPORT_ALWAYS_INLINE void updateRetxCount(uint64_t retx) { retx_count_ += retx; @@ -56,6 +58,14 @@ class TransportStatistics { interest_tx_ += int_tx; } + TRANSPORT_ALWAYS_INLINE void updateLossRatio(double loss_ratio) { + loss_ratio_ = loss_ratio; + } + + TRANSPORT_ALWAYS_INLINE void updateQueuingDelay(double queuing_delay) { + queuing_delay_ = queuing_delay; + } + TRANSPORT_ALWAYS_INLINE uint64_t getRetxCount() const { return retx_count_; } TRANSPORT_ALWAYS_INLINE uint64_t getBytesRecv() const { @@ -72,12 +82,21 @@ class TransportStatistics { return interest_tx_; } + TRANSPORT_ALWAYS_INLINE double getLossRatio() const { + return loss_ratio_; + } + + TRANSPORT_ALWAYS_INLINE double getQueuingDelay() const { + return queuing_delay_; + } + TRANSPORT_ALWAYS_INLINE void reset() { retx_count_ = 0; bytes_received_ = 0; average_rtt_ = 0; avg_window_size_ = 0; interest_tx_ = 0; + loss_ratio_ = 0; } private: @@ -87,6 +106,8 @@ class TransportStatistics { double avg_window_size_; uint64_t interest_tx_; double alpha_; + double loss_ratio_; + double queuing_delay_; }; } // end namespace protocol -- cgit 1.2.3-korg