Merge branch 'master' of opensimulator.org:/var/git/opensim

melanie
UbitUmarov 2016-11-20 14:42:30 +00:00
commit 0ce034d5d6
4 changed files with 30 additions and 10 deletions

View File

@ -430,11 +430,11 @@ namespace OpenSim.Framework
using (Stream dst = _request.GetRequestStream()) using (Stream dst = _request.GetRequestStream())
{ {
m_log.Info("[REST]: GetRequestStream is ok"); m_log.Debug("[REST]: GetRequestStream is ok");
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
int length = src.Read(buf, 0, 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) while (length > 0)
{ {
dst.Write(buf, 0, length); dst.Write(buf, 0, length);

View File

@ -77,6 +77,7 @@ namespace OpenSim.Services.FSAssetService
protected int m_missingAssetsFS = 0; protected int m_missingAssetsFS = 0;
protected string m_FSBase; protected string m_FSBase;
protected bool m_useOsgridFormat = false; protected bool m_useOsgridFormat = false;
protected bool m_showStats = true;
private static bool m_Initialized; private static bool m_Initialized;
private bool m_MainInstance; private bool m_MainInstance;
@ -186,6 +187,9 @@ namespace OpenSim.Services.FSAssetService
m_useOsgridFormat = assetConfig.GetBoolean("UseOsgridFormat", m_useOsgridFormat); 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) if (m_MainInstance)
{ {
string loader = assetConfig.GetString("DefaultAssetLoader", string.Empty); string loader = assetConfig.GetString("DefaultAssetLoader", string.Empty);
@ -203,9 +207,13 @@ namespace OpenSim.Services.FSAssetService
m_WriterThread = new Thread(Writer); m_WriterThread = new Thread(Writer);
m_WriterThread.Start(); m_WriterThread.Start();
if (m_showStats)
{
m_StatsThread = new Thread(Stats); m_StatsThread = new Thread(Stats);
m_StatsThread.Start(); m_StatsThread.Start();
} }
}
m_log.Info("[FSASSETS]: FS asset service enabled"); m_log.Info("[FSASSETS]: FS asset service enabled");
} }
@ -441,7 +449,7 @@ namespace OpenSim.Services.FSAssetService
Store(asset); Store(asset);
} }
} }
if (asset == null) if (asset == null && m_showStats)
{ {
// m_log.InfoFormat("[FSASSETS]: Asset {0} not found", id); // m_log.InfoFormat("[FSASSETS]: Asset {0} not found", id);
m_missingAssets++; m_missingAssets++;
@ -469,8 +477,11 @@ namespace OpenSim.Services.FSAssetService
} }
} }
if (asset == null) if (asset == null)
{
if (m_showStats)
m_missingAssetsFS++; m_missingAssetsFS++;
// m_log.InfoFormat("[FSASSETS]: Asset {0}, hash {1} not found in FS", id, hash); // m_log.InfoFormat("[FSASSETS]: Asset {0}, hash {1} not found in FS", id, hash);
}
else else
{ {
// Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8) // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8)
@ -484,11 +495,14 @@ namespace OpenSim.Services.FSAssetService
} }
} }
if (m_showStats)
{
lock (m_statsLock) lock (m_statsLock)
{ {
m_readTicks += Environment.TickCount - startTime; m_readTicks += Environment.TickCount - startTime;
m_readCount++; m_readCount++;
} }
}
// Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8) // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8)
// Fix bad assets before sending them elsewhere // Fix bad assets before sending them elsewhere

View File

@ -242,6 +242,9 @@
;; Reduces DB calls if asset is requested often. Default value 0 will always update access time ;; Reduces DB calls if asset is requested often. Default value 0 will always update access time
;DaysBetweenAccessTimeUpdates = 30 ;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) ;; FSAssets Custom Database Config (Leave blank to use grids default database configuration)
;StorageProvider = "" ;StorageProvider = ""
;ConnectionString = "" ;ConnectionString = ""

View File

@ -204,6 +204,9 @@
;; Reduces DB calls if asset is requested often. Default value 0 will always update access time ;; Reduces DB calls if asset is requested often. Default value 0 will always update access time
;DaysBetweenAccessTimeUpdates = 30 ;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) ;; FSAssets Custom Database Config (Leave blank to use grids default database configuration)
;StorageProvider = "" ;StorageProvider = ""
;ConnectionString = "" ;ConnectionString = ""