X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=win%2Finspircd_namedpipe.cpp;h=a460f41a2b9d0627f4996dde3ca8793e715215ad;hb=67c12453047f009692da518774ed6e49ee0acb9a;hp=d51172c05cd913da5610178a85e8debbe8048341;hpb=1ee5092d7528488b2e2160a57c5dcd433ac48d4d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/win/inspircd_namedpipe.cpp b/win/inspircd_namedpipe.cpp index d51172c05..a460f41a2 100644 --- a/win/inspircd_namedpipe.cpp +++ b/win/inspircd_namedpipe.cpp @@ -8,11 +8,13 @@ IPCThread::IPCThread(InspIRCd* Instance) : Thread(), ServerInstance(Instance) { + if (!initwmi()) + ServerInstance->Logs->Log("IPC", DEBUG, "Could not initialise WMI. CPU percantage reports will not be available."); } IPCThread::~IPCThread() { - + donewmi(); } void IPCThread::Run() @@ -22,19 +24,19 @@ void IPCThread::Run() while (GetExitFlag() == false) { Pipe = CreateNamedPipe (Pipename, - PIPE_ACCESS_DUPLEX, // read/write access - PIPE_TYPE_MESSAGE | // message type pipe - PIPE_READMODE_MESSAGE | // message-read mode - PIPE_WAIT, // blocking mode - PIPE_UNLIMITED_INSTANCES, // max. instances - MAXBUF, // output buffer size - MAXBUF, // input buffer size - 1000, // client time-out - NULL); // no security attribute + PIPE_ACCESS_DUPLEX, // read/write access + PIPE_TYPE_MESSAGE | // message type pipe + PIPE_READMODE_MESSAGE | // message-read mode + PIPE_WAIT, // blocking mode + PIPE_UNLIMITED_INSTANCES, // max. instances + MAXBUF, // output buffer size + MAXBUF, // input buffer size + 1000, // client time-out + NULL); // no security attribute if (Pipe == INVALID_HANDLE_VALUE) { - SleepEx(500, true); + SleepEx(10, true); continue; } @@ -83,6 +85,8 @@ void IPCThread::Run() stat << "kbitspersectotal " << kbitpersec_total << std::endl; 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; @@ -164,4 +168,4 @@ IPC::~IPC() { thread->SetExitFlag(); delete thread; -} \ No newline at end of file +}