diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-14 16:49:22 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-02-14 16:49:22 +0000 |
commit | ab4dee91de96555db158db91240ff91520318068 (patch) | |
tree | 1af96344a9c30466cec7e83ec9283efc9e8413a6 /src/socketengines/socketengine_iocp.cpp | |
parent | f4ddd40badd2eb5181dadc1dcd59d7200738bf24 (diff) |
Keep count of the number of events in total, and seperate read, write and error event counters. We can use this for monitoring of heavy socket engine activity, e.g. a 'stuck' eventhandler
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8933 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socketengines/socketengine_iocp.cpp')
-rw-r--r-- | src/socketengines/socketengine_iocp.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/socketengines/socketengine_iocp.cpp b/src/socketengines/socketengine_iocp.cpp index 4008c9d27..9b7dd63c7 100644 --- a/src/socketengines/socketengine_iocp.cpp +++ b/src/socketengines/socketengine_iocp.cpp @@ -302,10 +302,13 @@ int IOCPEngine::DispatchEvents() eh->GetExt("windows_readevent", m_readEvent); eh->GetExt("windows_writeevent", m_writeEvent); + TotalEvents++; + switch(ov->m_event) { case SOCKET_IO_EVENT_WRITE_READY: { + WriteEvents++; eh->Shrink("windows_writeevent"); eh->HandleEvent(EVENT_WRITE, 0); } @@ -313,6 +316,7 @@ int IOCPEngine::DispatchEvents() case SOCKET_IO_EVENT_READ_READY: { + ReadEvents++; if(ov->m_params) { // if we had params, it means we are a udp socket with a udp_overlap pointer in this long. @@ -346,6 +350,7 @@ int IOCPEngine::DispatchEvents() case SOCKET_IO_EVENT_ACCEPT: { /* this is kinda messy.. :/ */ + ReadEvents++; eh->HandleEvent(EVENT_READ, ov->m_params); delete ((accept_overlap*)ov->m_params); eh->Shrink("windows_acceptevent"); @@ -355,6 +360,7 @@ int IOCPEngine::DispatchEvents() case SOCKET_IO_EVENT_ERROR: { + ErrorEvents++; eh->HandleEvent(EVENT_ERROR, ov->m_params); } break; |