From a3802dee4bdfcf3dc11df09c59e6ed1912fbadd9 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 18 Jun 2008 20:27:47 +0000 Subject: Measure bandwidth statistics from the socket engine (kiloBITS per second in, out, total) and display them in /stats z plus send them via the named pipe to the windows gui git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9918 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/socketengine.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include') diff --git a/include/socketengine.h b/include/socketengine.h index f647f4df3..f16ec3fea 100644 --- a/include/socketengine.h +++ b/include/socketengine.h @@ -170,6 +170,12 @@ protected: EventHandler** ref; int MAX_DESCRIPTORS; + + size_t indata; + size_t outdata; + time_t lastempty; + + void UpdateStats(size_t len_in, size_t len_out); public: double TotalEvents; @@ -396,6 +402,10 @@ public: * the shell or operating system on fatal error. */ virtual void RecoverFromFork(); + + /** Get data transfer statistics, kilobits per second in and out and total. + */ + void GetStats(float &kbitpersec_in, float &kbitpersec_out, float &kbitpersec_total); }; #endif -- cgit v1.2.3