transfer stats

This commit is contained in:
2024-07-13 11:46:33 +02:00
parent 31253f5708
commit dd04e6131a
7 changed files with 190 additions and 3 deletions

View File

@@ -116,11 +116,17 @@ namespace Components {
struct TransferStatsTally {
struct Peer {
struct Entry {
float time_since {0.f};
float time_point {0.f};
size_t bytes {0u};
bool accounted {false};
};
std::deque<Entry> recently_sent;
std::deque<Entry> recently_received;
// keep atleast 4 or 1sec
// trim too old front
void trimSent(const float time_now);
void trimReceived(const float time_now);
};
entt::dense_map<Contact3, Peer> tally;
};