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 --- win/inspircd_namedpipe.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'win/inspircd_namedpipe.cpp') diff --git a/win/inspircd_namedpipe.cpp b/win/inspircd_namedpipe.cpp index 30aab9cd4..3f0f47fdf 100644 --- a/win/inspircd_namedpipe.cpp +++ b/win/inspircd_namedpipe.cpp @@ -62,9 +62,12 @@ void IPCThread::Run() std::stringstream stat; DWORD Written = 0; + float kbitpersec_in, kbitpersec_out, kbitpersec_total; PROCESS_MEMORY_COUNTERS MemCounters; + ServerInstance->SE->GetStats(kbitpersec_in, kbitpersec_out, kbitpersec_total); + bool HaveMemoryStats = GetProcessMemoryInfo(GetCurrentProcess(), &MemCounters, sizeof(MemCounters)); stat << "name " << ServerInstance->Config->ServerName << std::endl; @@ -77,6 +80,9 @@ void IPCThread::Run() stat << "pid " << GetProcessId(GetCurrentProcess()) << std::endl; stat << "request " << oldrequest << std::endl; stat << "result " << this->GetResult() << std::endl; + stat << "kbitspersectotal " << kbitpersec_total << std::endl; + stat << "kbitspersecout " << kbitpersec_out << std::endl; + stat << "kbitspersecin " << kbitpersec_in << std::endl; if (HaveMemoryStats) { stat << "workingset " << MemCounters.WorkingSetSize << std::endl; -- cgit v1.2.3