summaryrefslogtreecommitdiff
path: root/win/inspircd_namedpipe.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-20 09:56:16 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-20 09:56:16 +0000
commit1bdc61df779bbd74ca8641cde512dc0a1d8be4c0 (patch)
tree8ce08ee24ff6fcfe18159be0e23f0f3df92ccb5c /win/inspircd_namedpipe.cpp
parent8e83ee21a601747b5b1a391435fde8440a0c1d5f (diff)
WMI calls for getting cpu percentage of current process. This code was a biatch and a half.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10179 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'win/inspircd_namedpipe.cpp')
-rw-r--r--win/inspircd_namedpipe.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/win/inspircd_namedpipe.cpp b/win/inspircd_namedpipe.cpp
index 6c836cd6a..f86af73e2 100644
--- a/win/inspircd_namedpipe.cpp
+++ b/win/inspircd_namedpipe.cpp
@@ -8,11 +8,12 @@
IPCThread::IPCThread(InspIRCd* Instance) : Thread(), ServerInstance(Instance)
{
+ initwmi();
}
IPCThread::~IPCThread()
{
-
+ donewmi();
}
void IPCThread::Run()
@@ -84,6 +85,7 @@ void IPCThread::Run()
stat << "kbitspersecout " << kbitpersec_out << std::endl;
stat << "kbitspersecin " << kbitpersec_in << std::endl;
stat << "uptime " << ServerInstance->Time() - ServerInstance->startup_time << std::endl;
+ stat << "cpu " << getcpu() << std::endl;
if (HaveMemoryStats)
{
stat << "workingset " << MemCounters.WorkingSetSize << std::endl;