aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/net/network_throttle-detail.hpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-01-25 20:51:59 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-02-01 21:33:13 +0000
commit7c3ade4410e410abf69daa47db3bca7b8b1b0f3e (patch)
treee2d90c6c35fe603e9f62c3c96f911acde974e65d /contrib/epee/include/net/network_throttle-detail.hpp
parentMerge pull request #5008 (diff)
downloadmonero-7c3ade4410e410abf69daa47db3bca7b8b1b0f3e.tar.xz
network_throttle: use circular_buffer where appropriate
Diffstat (limited to 'contrib/epee/include/net/network_throttle-detail.hpp')
-rw-r--r--contrib/epee/include/net/network_throttle-detail.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/epee/include/net/network_throttle-detail.hpp b/contrib/epee/include/net/network_throttle-detail.hpp
index 955668d62..9d12291f4 100644
--- a/contrib/epee/include/net/network_throttle-detail.hpp
+++ b/contrib/epee/include/net/network_throttle-detail.hpp
@@ -36,6 +36,7 @@
#ifndef INCLUDED_throttle_detail_hpp
#define INCLUDED_throttle_detail_hpp
+#include <boost/circular_buffer.hpp>
#include "network_throttle.hpp"
namespace epee
@@ -61,7 +62,7 @@ class network_throttle : public i_network_throttle {
network_time_seconds m_slot_size; // the size of one slot. TODO: now hardcoded for 1 second e.g. in time_to_slot()
// TODO for big window size, for performance better the substract on change of m_last_sample_time instead of recalculating average of eg >100 elements
- std::vector< packet_info > m_history; // the history of bw usage
+ boost::circular_buffer< packet_info > m_history; // the history of bw usage
network_time_seconds m_last_sample_time; // time of last history[0] - so we know when to rotate the buffer
network_time_seconds m_start_time; // when we were created
bool m_any_packet_yet; // did we yet got any packet to count