From ff7b20bef108bd129c7ff1fcd54cce37ac557132 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 5 Mar 2009 21:36:48 +0000 Subject: * Add more status information when an oar is being saved * Among other messages, a log entry is posted for every 50 assets added to the archive --- .../World/Archiver/ArchiveWriteRequestExecution.cs | 8 ++++++++ .../Region/CoreModules/World/Archiver/AssetsArchiver.cs | 15 +++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs index f9d283b..b5aa0f3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs @@ -90,10 +90,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver // Write out control file archive.AddFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile()); + m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); + // Write out region settings string settingsPath = String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName); archive.AddFile(settingsPath, RegionSettingsSerializer.Serialize(m_scene.RegionInfo.RegionSettings)); + + m_log.InfoFormat("[ARCHIVER]: Added region settings to archive."); // Write out terrain string terrainPath @@ -103,6 +107,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_terrainModule.SaveToStream(terrainPath, ms); archive.AddFile(terrainPath, ms.ToArray()); ms.Close(); + + m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); // Write out scene object metadata foreach (SceneObjectGroup sceneObject in m_sceneObjects) @@ -121,6 +127,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver archive.AddFile(filename, serializedObject); } + + m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive."); // Write out assets AssetsArchiver assetsArchiver = new AssetsArchiver(assetsFound); diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs index abd90de..e863188 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs @@ -42,6 +42,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// + /// Post a message to the log every x assets as a progress bar + /// + private static int LOG_ASSET_LOAD_NOTIFICATION_INTERVAL = 50; + /// /// Archive assets /// @@ -116,6 +121,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver { // It appears that gtar, at least, doesn't need the intermediate directory entries in the tar //archive.AddDir("assets"); + + int assetsAdded = 0; foreach (UUID uuid in m_assets.Keys) { @@ -137,7 +144,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver archive.AddFile( ArchiveConstants.ASSETS_PATH + uuid.ToString() + extension, asset.Data); + + assetsAdded++; + + if (assetsAdded % LOG_ASSET_LOAD_NOTIFICATION_INTERVAL == 0) + m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", assetsAdded); } + + if (assetsAdded % LOG_ASSET_LOAD_NOTIFICATION_INTERVAL != 0) + m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", assetsAdded); } } } -- cgit v1.1