26 void processStats(
const std::vector<std::shared_ptr<TaraxaPeer>>& all_peers);
Definition: FixedHash.h:35
MAx stats data holder class.
Definition: max_stats.hpp:12
Stats single packet type.
Definition: packet_stats.hpp:13
Stats for all packet types.
Definition: packets_stats.hpp:13
Stats for all received and sent packets of all types.
Definition: time_period_packets_stats.hpp:16
const std::chrono::milliseconds kResetTimePeriod
Definition: time_period_packets_stats.hpp:42
void processStats(const std::vector< std::shared_ptr< TaraxaPeer >> &all_peers)
Logs both received as well as sent packets stats + updates max count/size and reset stats.
Definition: time_period_packets_stats.cpp:42
PacketsStats received_packets_stats_
Definition: time_period_packets_stats.hpp:46
void addSentPacket(const std::string &packet_type, const dev::p2p::NodeID &node, const PacketStats &packet)
Definition: time_period_packets_stats.cpp:21
void addReceivedPacket(const std::string &packet_type, const dev::p2p::NodeID &node, const PacketStats &packet)
Definition: time_period_packets_stats.cpp:15
TimePeriodPacketsStats(std::chrono::milliseconds reset_time_period, const addr_t &node_addr={})
Definition: time_period_packets_stats.cpp:10
PacketsStats sent_packets_stats_
Definition: time_period_packets_stats.hpp:45
std::pair< bool, std::chrono::milliseconds > validMaxStatsTimePeriod(const std::chrono::system_clock::time_point &start_time) const
Checks if now() - start_time is approximately equal to kResetTimePeriod. Stats are reset in regular i...
Definition: time_period_packets_stats.cpp:27
MaxStats peer_max_stats_
Definition: time_period_packets_stats.hpp:49
#define LOG_OBJECTS_DEFINE
Definition: logger.hpp:60
std::chrono::system_clock::time_point time_point
Definition: watches.hpp:12
Definition: vote_manager.hpp:23