From ce14345a89dfa05992f8d2c7c9fe36315d4a67e6 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Fri, 23 Aug 2013 02:09:32 +1000 Subject: Add network traffic graph --- src/net.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/net.h') diff --git a/src/net.h b/src/net.h index b57f38fe3a..ab1b69acb7 100644 --- a/src/net.h +++ b/src/net.h @@ -298,8 +298,15 @@ public: } private: + // Network usage totals + static CCriticalSection cs_totalBytesRecv; + static CCriticalSection cs_totalBytesSent; + static uint64 nTotalBytesRecv; + static uint64 nTotalBytesSent; + CNode(const CNode&); void operator=(const CNode&); + public: @@ -646,6 +653,13 @@ public: static bool IsBanned(CNetAddr ip); bool Misbehaving(int howmuch); // 1 == a little, 100 == a lot void copyStats(CNodeStats &stats); + + // Network stats + static void RecordBytesRecv(uint64 bytes); + static void RecordBytesSent(uint64 bytes); + + static uint64 GetTotalBytesRecv(); + static uint64 GetTotalBytesSent(); }; -- cgit v1.2.3