summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-06-18 20:27:47 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-06-18 20:27:47 +0000
commita3802dee4bdfcf3dc11df09c59e6ed1912fbadd9 (patch)
tree0c8a3cc293f02828aebedbbb1f5228cd627f3b2a /win
parented6fcd4a50f3a0d84ae07a8a0011b193e00cf088 (diff)
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
Diffstat (limited to 'win')
-rw-r--r--win/inspircd_namedpipe.cpp6
1 files changed, 6 insertions, 0 deletions
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;