From 1d998a770b2c4ce53b0482d1360668ea4142ebe0 Mon Sep 17 00:00:00 2001 From: AliciaRaven Date: Sun, 20 Nov 2016 13:52:06 +0000 Subject: [PATCH 1/2] Change some minor log messages to debug level in Rest client code. --- OpenSim/Framework/RestClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/RestClient.cs b/OpenSim/Framework/RestClient.cs index ca1939218b..26237deae4 100644 --- a/OpenSim/Framework/RestClient.cs +++ b/OpenSim/Framework/RestClient.cs @@ -430,11 +430,11 @@ namespace OpenSim.Framework using (Stream dst = _request.GetRequestStream()) { - m_log.Info("[REST]: GetRequestStream is ok"); + m_log.Debug("[REST]: GetRequestStream is ok"); byte[] buf = new byte[1024]; int length = src.Read(buf, 0, 1024); - m_log.Info("[REST]: First Read is ok"); + m_log.Debug("[REST]: First Read is ok"); while (length > 0) { dst.Write(buf, 0, length); From 05f70024451e99f8e136499c04d645960a6b5f3a Mon Sep 17 00:00:00 2001 From: AliciaRaven Date: Sun, 20 Nov 2016 14:20:54 +0000 Subject: [PATCH 2/2] Include config option to disable stats thread showing read/write stats in console. Keeping default as true to retain current behaviour. Also checked to prevent counters being added to so there wont be any integer overflows over time --- .../Services/FSAssetService/FSAssetService.cs | 30 ++++++++++++++----- bin/Robust.HG.ini.example | 3 ++ bin/Robust.ini.example | 3 ++ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/OpenSim/Services/FSAssetService/FSAssetService.cs b/OpenSim/Services/FSAssetService/FSAssetService.cs index 9ec2d00a57..7f1446272e 100644 --- a/OpenSim/Services/FSAssetService/FSAssetService.cs +++ b/OpenSim/Services/FSAssetService/FSAssetService.cs @@ -77,6 +77,7 @@ namespace OpenSim.Services.FSAssetService protected int m_missingAssetsFS = 0; protected string m_FSBase; protected bool m_useOsgridFormat = false; + protected bool m_showStats = true; private static bool m_Initialized; private bool m_MainInstance; @@ -186,6 +187,9 @@ namespace OpenSim.Services.FSAssetService m_useOsgridFormat = assetConfig.GetBoolean("UseOsgridFormat", m_useOsgridFormat); + // Default is to show stats to retain original behaviour + m_showStats = assetConfig.GetBoolean("ShowConsoleStats", m_showStats); + if (m_MainInstance) { string loader = assetConfig.GetString("DefaultAssetLoader", string.Empty); @@ -203,8 +207,12 @@ namespace OpenSim.Services.FSAssetService m_WriterThread = new Thread(Writer); m_WriterThread.Start(); - m_StatsThread = new Thread(Stats); - m_StatsThread.Start(); + + if (m_showStats) + { + m_StatsThread = new Thread(Stats); + m_StatsThread.Start(); + } } m_log.Info("[FSASSETS]: FS asset service enabled"); @@ -441,7 +449,7 @@ namespace OpenSim.Services.FSAssetService Store(asset); } } - if (asset == null) + if (asset == null && m_showStats) { // m_log.InfoFormat("[FSASSETS]: Asset {0} not found", id); m_missingAssets++; @@ -469,8 +477,11 @@ namespace OpenSim.Services.FSAssetService } } if (asset == null) - m_missingAssetsFS++; - // m_log.InfoFormat("[FSASSETS]: Asset {0}, hash {1} not found in FS", id, hash); + { + if (m_showStats) + m_missingAssetsFS++; + // m_log.InfoFormat("[FSASSETS]: Asset {0}, hash {1} not found in FS", id, hash); + } else { // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8) @@ -484,10 +495,13 @@ namespace OpenSim.Services.FSAssetService } } - lock (m_statsLock) + if (m_showStats) { - m_readTicks += Environment.TickCount - startTime; - m_readCount++; + lock (m_statsLock) + { + m_readTicks += Environment.TickCount - startTime; + m_readCount++; + } } // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8) diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index ad076743d3..c231a8a5ca 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -242,6 +242,9 @@ ;; Reduces DB calls if asset is requested often. Default value 0 will always update access time ;DaysBetweenAccessTimeUpdates = 30 + ;; Should FSAssets print read/write stats to the robust console, default is true + ;ShowConsoleStats = true + ;; FSAssets Custom Database Config (Leave blank to use grids default database configuration) ;StorageProvider = "" ;ConnectionString = "" diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example index 099d4da247..743b23dbc5 100644 --- a/bin/Robust.ini.example +++ b/bin/Robust.ini.example @@ -204,6 +204,9 @@ ;; Reduces DB calls if asset is requested often. Default value 0 will always update access time ;DaysBetweenAccessTimeUpdates = 30 + ;; Should FSAssets print read/write stats to the robust console, default is true + ;ShowConsoleStats = true + ;; FSAssets Custom Database Config (Leave blank to use grids default database configuration) ;StorageProvider = "" ;ConnectionString = ""