Merge pull request #1020 from jpnurmi/traffic

Calculate per-network traffic (#963)
This commit is contained in:
J-P Nurmi
2015-09-02 01:01:13 +02:00
10 changed files with 165 additions and 31 deletions
+8
View File
@@ -196,6 +196,12 @@ public:
unsigned short int GetJoinDelay() const { return m_uJoinDelay; }
void SetJoinDelay(unsigned short int uJoinDelay) { m_uJoinDelay = uJoinDelay; }
unsigned long long BytesRead() const { return m_uBytesRead; }
unsigned long long BytesWritten() const { return m_uBytesWritten; }
void AddBytesRead(unsigned long long u) { m_uBytesRead += u; }
void AddBytesWritten(unsigned long long u) { m_uBytesWritten += u; }
CString ExpandString(const CString& sStr) const;
CString& ExpandString(const CString& sStr, CString& sRet) const;
private:
@@ -245,6 +251,8 @@ protected:
CIRCNetworkJoinTimer* m_pJoinTimer;
unsigned short int m_uJoinDelay;
unsigned long long m_uBytesRead;
unsigned long long m_uBytesWritten;
};
#endif // !ZNC_IRCNETWORK_H
+2 -2
View File
@@ -187,8 +187,8 @@ public:
bool AutoClearQueryBuffer() const;
bool IsBeingDeleted() const { return m_bBeingDeleted; }
CString GetTimezone() const { return m_sTimezone; }
unsigned long long BytesRead() const { return m_uBytesRead; }
unsigned long long BytesWritten() const { return m_uBytesWritten; }
unsigned long long BytesRead() const;
unsigned long long BytesWritten() const;
unsigned int JoinTries() const { return m_uMaxJoinTries; }
unsigned int MaxJoins() const { return m_uMaxJoins; }
CString GetSkinName() const;
+1
View File
@@ -92,6 +92,7 @@ public:
// generated through ZNC.
TrafficStatsMap GetTrafficStats(TrafficStatsPair &Users,
TrafficStatsPair &ZNC, TrafficStatsPair &Total);
TrafficStatsMap GetNetworkTrafficStats(const CString& sUsername, TrafficStatsPair& Total);
// Authenticate a user.
// The result is passed back via callbacks to CAuthBase.