[mapguide-commits] r4605 - in sandbox/adsk/2.2gp/Server/src: Common/Manager Services/ServerAdmin

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Feb 22 01:30:03 EST 2010


Author: brucedechant
Date: 2010-02-22 01:30:02 -0500 (Mon, 22 Feb 2010)
New Revision: 4605

Modified:
   sandbox/adsk/2.2gp/Server/src/Common/Manager/ServerManager.cpp
   sandbox/adsk/2.2gp/Server/src/Common/Manager/ServerManager.vcproj
   sandbox/adsk/2.2gp/Server/src/Services/ServerAdmin/OpGetInformationProperties.cpp
Log:
Fix for trac ticket 1273 - Update to support GetProcessMemoryInfo() on all supported Windows platforms
http://trac.osgeo.org/mapguide/ticket/1273

Notes:
- Added ?\226?\128?\147DPSAPI_VERSION=1 to project settings
- Added missing information to GetInformationProperties() when system APIs fail


Modified: sandbox/adsk/2.2gp/Server/src/Common/Manager/ServerManager.cpp
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Common/Manager/ServerManager.cpp	2010-02-20 23:52:48 UTC (rev 4604)
+++ sandbox/adsk/2.2gp/Server/src/Common/Manager/ServerManager.cpp	2010-02-22 06:30:02 UTC (rev 4605)
@@ -533,6 +533,14 @@
         pProperty = new MgInt64Property(MgServerInformationProperties::VirtualMemory, counters.PagefileUsage);
         pProperties->Add(pProperty);
     }
+    else
+    {
+        // Failed to get required information
+        pProperty = new MgInt64Property(MgServerInformationProperties::WorkingSet, -1);
+        pProperties->Add(pProperty);
+        pProperty = new MgInt64Property(MgServerInformationProperties::VirtualMemory, -1);
+        pProperties->Add(pProperty);
+    }
 #else
     // getrusage does not work on Linux so pull information directly
     // from proc filesystem.
@@ -557,17 +565,37 @@
             pProperty = new MgInt64Property(MgServerInformationProperties::WorkingSet, workingSet);
             pProperties->Add(pProperty);
         }
+        else
+        {
+            // Failed to get required information
+            pProperty = new MgInt64Property(MgServerInformationProperties::WorkingSet, -1);
+            pProperties->Add(pProperty);
+        }
 
         char* strSize = "VmSize:";
         loc = strstr(buf, strSize);
         if (NULL != loc)
         {
             long kbytes = strtol(loc + strlen(strSize) + 1, &end, 10);
-            INT64 workingSet = kbytes * 1000;
-            pProperty = new MgInt64Property(MgServerInformationProperties::VirtualMemory, workingSet);
+            INT64 virtualMemory = kbytes * 1000;
+            pProperty = new MgInt64Property(MgServerInformationProperties::VirtualMemory, virtualMemory);
             pProperties->Add(pProperty);
         }
+        else
+        {
+            // Failed to get required information
+            pProperty = new MgInt64Property(MgServerInformationProperties::VirtualMemory, -1);
+            pProperties->Add(pProperty);
+        }
     }
+    else
+    {
+        // Failed to get required information
+        pProperty = new MgInt64Property(MgServerInformationProperties::WorkingSet, -1);
+        pProperties->Add(pProperty);
+        pProperty = new MgInt64Property(MgServerInformationProperties::VirtualMemory, -1);
+        pProperties->Add(pProperty);
+    }
 #endif
 
     // Add cache information
@@ -584,7 +612,16 @@
         pProperty = new MgInt32Property(MgServerInformationProperties::CacheDroppedEntries, fsCacheDroppedEntries);
         pProperties->Add(pProperty);
     }
+    else
+    {
+        // Failed to get required information
+        pProperty = new MgInt32Property(MgServerInformationProperties::CacheSize, -1);
+        pProperties->Add(pProperty);
 
+        pProperty = new MgInt32Property(MgServerInformationProperties::CacheDroppedEntries, -1);
+        pProperties->Add(pProperty);
+    }
+
     MG_CATCH_AND_THROW(L"MgServerManager.GetInformationProperties")
 
     return pProperties.Detach();

Modified: sandbox/adsk/2.2gp/Server/src/Common/Manager/ServerManager.vcproj
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Common/Manager/ServerManager.vcproj	2010-02-20 23:52:48 UTC (rev 4604)
+++ sandbox/adsk/2.2gp/Server/src/Common/Manager/ServerManager.vcproj	2010-02-22 06:30:02 UTC (rev 4605)
@@ -45,7 +45,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS;PSAPI_VERSION=1"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
 				BasicRuntimeChecks="3"
@@ -127,7 +127,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS;PSAPI_VERSION=1"
 				MinimalRebuild="true"
 				ExceptionHandling="2"
 				BasicRuntimeChecks="3"
@@ -208,7 +208,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS;PSAPI_VERSION=1"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
 				WarningLevel="3"
@@ -289,7 +289,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				AdditionalIncludeDirectories="..;..\..\..\..\Common;..\..\..\..\Common\Foundation;..\..\..\..\Common\PlatformBase;..\..\..\..\Common\MapGuideCommon;..\..\..\..\Common\Geometry;..\..\..\..\Common\MdfModel;..\..\..\..\Common\MdfParser;..\..\..\..\Common\Security;..\..\Common\Cache;..\..\Common\Thread;..\..\Services\Drawing;..\..\Services\Feature;..\..\Services\Kml;..\..\Services\Mapping;..\..\Services\Rendering;..\..\Services\Resource;..\..\Services\ServerAdmin;..\..\Services\Site;..\..\Services\Tile;..\..\..\..\Oem\ACE\ACE_wrappers;..\..\..\..\Oem\dbxml-2.3.10\xerces-c-src\src;..\..\..\..\Oem\FDO\inc"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MG_SERVER_MANAGER_EXPORTS;PSAPI_VERSION=1"
 				ExceptionHandling="2"
 				RuntimeLibrary="2"
 				WarningLevel="3"

Modified: sandbox/adsk/2.2gp/Server/src/Services/ServerAdmin/OpGetInformationProperties.cpp
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Services/ServerAdmin/OpGetInformationProperties.cpp	2010-02-20 23:52:48 UTC (rev 4604)
+++ sandbox/adsk/2.2gp/Server/src/Services/ServerAdmin/OpGetInformationProperties.cpp	2010-02-22 06:30:02 UTC (rev 4605)
@@ -113,5 +113,8 @@
     // Add admin log entry for operation
     MG_LOG_OPERATION_MESSAGE_ADMIN_ENTRY();
 
+    // Add access log entry for operation
+    MG_LOG_OPERATION_MESSAGE_ACCESS_ENTRY();
+
     MG_THROW()
 }



More information about the mapguide-commits mailing list