/*=================================================================== Microsoft Denali Microsoft Confidential. Copyright 1996 Microsoft Corporation. All Rights Reserved. Component: ASP Status Html Dump File: htmldump.cpp Owner: dmitryr This file contains the ASP status html dump code used from IISPROBE.DLL ===================================================================*/ #include "denpre.h" #pragma hdrstop #include "gip.h" #include "mtacb.h" #include "perfdata.h" #include "activdbg.h" #include "debugger.h" #include "dbgutil.h" #include "randgen.h" #include "aspdmon.h" #include "memcls.h" #include "memchk.h" /*=================================================================== Helper classes and functions ===================================================================*/ class CAspDump { private: char *m_szBuffer; DWORD m_dwMaxSize; DWORD m_dwActSize; public: CAspDump(char *szBuffer, DWORD dwMaxSize) { m_szBuffer = szBuffer; m_dwMaxSize = dwMaxSize; m_dwActSize = 0; } inline void __cdecl Dump(LPCSTR fmt, ...) { char szStr[512]; va_list marker; va_start(marker, fmt); vsprintf(szStr, fmt, marker); va_end(marker); DWORD len = strlen(szStr); if (len > 0 && len < (m_dwMaxSize-m_dwActSize)) { memcpy(m_szBuffer+m_dwActSize, szStr, len+1); m_dwActSize += len; } } DWORD GetSize() { return m_dwActSize; } }; /*=================================================================== AspStatusHtmlDump Function called from IISPROBE.DLL Fills in the buffer with the ASP status as HTML Parameters: szBuffer buffer to fill in pwdSize in - max buffer len out - actual buffer len filled Returns: TRUE ===================================================================*/ extern "C" BOOL WINAPI AspStatusHtmlDump(char *szBuffer, DWORD *pdwSize) { CAspDump dump(szBuffer, *pdwSize); dump.Dump("
Misc. Globals\r\n"); dump.Dump(" | |
fShutDownInProgress | %d\r\n", g_fShutDownInProgress); dump.Dump(" |
nApplications | %d\r\n", g_nApplications); dump.Dump(" |
nApplicationsRestarting | %d\r\n", g_nApplicationsRestarting); dump.Dump(" |
nSessions | %d\r\n", g_nSessions); dump.Dump(" |
nBrowserRequests | %d\r\n", g_nBrowserRequests); dump.Dump(" |
nSessionCleanupRequests | %d\r\n", g_nSessionCleanupRequests); dump.Dump(" |
nApplnCleanupRequests | %d\r\n", g_nApplnCleanupRequests); dump.Dump(" |
pPDM (debugger) | %08p\r\n", g_pPDM); dump.Dump(" |
Selected PerfMon Counters\r\n"); dump.Dump(" | |
Last request's execution time, ms | %d\r\n", *g_PerfData.PLCounter(ID_REQEXECTIME)); dump.Dump(" |
Last request's wait time, ms | %d\r\n", *g_PerfData.PLCounter(ID_REQWAITTIME)); dump.Dump(" |
Number of executing requests | %d\r\n", *g_PerfData.PLCounter(ID_REQBROWSEREXEC)); dump.Dump(" |
Number of requests waiting in the queue | %d\r\n", *g_PerfData.PLCounter(ID_REQCURRENT)); dump.Dump(" |
Number of rejected requests | %d\r\n", *g_PerfData.PLCounter(ID_REQREJECTED)); dump.Dump(" |
Total number of requests | %d\r\n", *g_PerfData.PLCounter(ID_REQTOTAL)); dump.Dump(" |
Last session's duration, ms | %d\r\n", *g_PerfData.PLCounter(ID_SESSIONLIFETIME)); dump.Dump(" |
Current number of sessions | %d\r\n", *g_PerfData.PLCounter(ID_SESSIONCURRENT)); dump.Dump(" |
Total number of sessions | %d\r\n", *g_PerfData.PLCounter(ID_SESSIONSTOTAL)); dump.Dump(" |
Number of cached templates | %d\r\n", *g_PerfData.PLCounter(ID_TEMPLCACHE)); dump.Dump(" |
Number of pending transactions | %d\r\n", *g_PerfData.PLCounter(ID_TRANSPENDING)); dump.Dump(" |
Applications\r\n"); CApplnIterator ApplnIterator; ApplnIterator.Start(); CAppln *pAppln; while (pAppln = ApplnIterator.Next()) { dump.Dump(" | |
%08p\r\n", pAppln); dump.Dump(" | |
metabase key | %s\r\n", pAppln->GetMetabaseKey()); dump.Dump(" |
physical path | %s\r\n", pAppln->GetApplnPath(SOURCEPATHTYPE_PHYSICAL)); dump.Dump(" |
virtual path | %s\r\n", pAppln->GetApplnPath(SOURCEPATHTYPE_VIRTUAL)); dump.Dump(" |
number of sessions | %d\r\n", pAppln->GetNumSessions()); dump.Dump(" |
number of requests | %d\r\n", pAppln->GetNumRequests()); #if 0 dump.Dump(" |
global.asa path | %s\r\n", pAppln->FHasGlobalAsa() ? pAppln->GetGlobalAsa() : "n/a"); #endif dump.Dump(" |
global changed? | %d\r\n", pAppln->FGlobalChanged()); dump.Dump(" |
tombstone? | %d\r\n", pAppln->FTombstone()); dump.Dump(" |
debuggable? | %d\r\n", pAppln->FDebuggable()); CSessionMgr *pSessionMgr = pAppln->PSessionMgr(); dump.Dump(" |
session manager | %08p\r\n", pSessionMgr); if (pSessionMgr) { dump.Dump(" |
session killer scheduled? | %d\r\n", pSessionMgr->FIsSessionKillerScheduled()); dump.Dump(" |
session cleanup requests | %d\r\n", pSessionMgr->GetNumSessionCleanupRequests()); } else { } } ApplnIterator.Stop(); dump.Dump(" |