diff options
author | rbrunner7 <rbrunner@dreamshare.ch> | 2019-03-21 11:03:24 +0100 |
---|---|---|
committer | rbrunner7 <rbrunner@dreamshare.ch> | 2019-03-24 16:58:57 +0100 |
commit | c23ea7962debe4e66fd3c0e7719117dcb7966d1f (patch) | |
tree | 4627040783eac198cbcdde56e47a8e16c3a16b77 /contrib/epee/include | |
parent | Merge pull request #5201 (diff) | |
download | monero-c23ea7962debe4e66fd3c0e7719117dcb7966d1f.tar.xz |
New interactive daemon command 'print_net_stats': Global traffic stats
Diffstat (limited to 'contrib/epee/include')
-rw-r--r-- | contrib/epee/include/net/network_throttle-detail.hpp | 3 | ||||
-rw-r--r-- | contrib/epee/include/net/network_throttle.hpp | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/contrib/epee/include/net/network_throttle-detail.hpp b/contrib/epee/include/net/network_throttle-detail.hpp index d7f2cc37a..353ae0c0c 100644 --- a/contrib/epee/include/net/network_throttle-detail.hpp +++ b/contrib/epee/include/net/network_throttle-detail.hpp @@ -66,6 +66,8 @@ class network_throttle : public i_network_throttle { 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 + uint64_t m_total_packets; + uint64_t m_total_bytes; std::string m_name; // my name for debug and logs std::string m_nameshort; // my name for debug and logs (used in log file name) @@ -95,6 +97,7 @@ class network_throttle : public i_network_throttle { virtual size_t get_recommended_size_of_planned_transport() const; ///< what should be the size (bytes) of next data block to be transported virtual size_t get_recommended_size_of_planned_transport_window(double force_window) const; ///< ditto, but for given windows time frame virtual double get_current_speed() const; + virtual void get_stats(uint64_t &total_packets, uint64_t &total_bytes) const; private: virtual network_time_seconds time_to_slot(network_time_seconds t) const { return std::floor( t ); } // convert exact time eg 13.7 to rounded time for slot number in history 13 diff --git a/contrib/epee/include/net/network_throttle.hpp b/contrib/epee/include/net/network_throttle.hpp index 5092241a4..02a286326 100644 --- a/contrib/epee/include/net/network_throttle.hpp +++ b/contrib/epee/include/net/network_throttle.hpp @@ -152,7 +152,8 @@ class i_network_throttle { virtual size_t get_recommended_size_of_planned_transport() const =0; // what should be the recommended limit of data size that we can transport over current network_throttle in near future virtual double get_time_seconds() const =0; // a timer - virtual void logger_handle_net(const std::string &filename, double time, size_t size)=0; + virtual void logger_handle_net(const std::string &filename, double time, size_t size)=0; + virtual void get_stats(uint64_t &total_packets, uint64_t &total_bytes) const =0; }; |