diff options
Merge branch 'master' of opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Services/FSAssetService/FSAssetService.cs')
-rw-r--r-- | OpenSim/Services/FSAssetService/FSAssetService.cs | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/OpenSim/Services/FSAssetService/FSAssetService.cs b/OpenSim/Services/FSAssetService/FSAssetService.cs index 9ec2d00..7f14462 100644 --- a/OpenSim/Services/FSAssetService/FSAssetService.cs +++ b/OpenSim/Services/FSAssetService/FSAssetService.cs | |||
@@ -77,6 +77,7 @@ namespace OpenSim.Services.FSAssetService | |||
77 | protected int m_missingAssetsFS = 0; | 77 | protected int m_missingAssetsFS = 0; |
78 | protected string m_FSBase; | 78 | protected string m_FSBase; |
79 | protected bool m_useOsgridFormat = false; | 79 | protected bool m_useOsgridFormat = false; |
80 | protected bool m_showStats = true; | ||
80 | 81 | ||
81 | private static bool m_Initialized; | 82 | private static bool m_Initialized; |
82 | private bool m_MainInstance; | 83 | private bool m_MainInstance; |
@@ -186,6 +187,9 @@ namespace OpenSim.Services.FSAssetService | |||
186 | 187 | ||
187 | m_useOsgridFormat = assetConfig.GetBoolean("UseOsgridFormat", m_useOsgridFormat); | 188 | m_useOsgridFormat = assetConfig.GetBoolean("UseOsgridFormat", m_useOsgridFormat); |
188 | 189 | ||
190 | // Default is to show stats to retain original behaviour | ||
191 | m_showStats = assetConfig.GetBoolean("ShowConsoleStats", m_showStats); | ||
192 | |||
189 | if (m_MainInstance) | 193 | if (m_MainInstance) |
190 | { | 194 | { |
191 | string loader = assetConfig.GetString("DefaultAssetLoader", string.Empty); | 195 | string loader = assetConfig.GetString("DefaultAssetLoader", string.Empty); |
@@ -203,8 +207,12 @@ namespace OpenSim.Services.FSAssetService | |||
203 | 207 | ||
204 | m_WriterThread = new Thread(Writer); | 208 | m_WriterThread = new Thread(Writer); |
205 | m_WriterThread.Start(); | 209 | m_WriterThread.Start(); |
206 | m_StatsThread = new Thread(Stats); | 210 | |
207 | m_StatsThread.Start(); | 211 | if (m_showStats) |
212 | { | ||
213 | m_StatsThread = new Thread(Stats); | ||
214 | m_StatsThread.Start(); | ||
215 | } | ||
208 | } | 216 | } |
209 | 217 | ||
210 | m_log.Info("[FSASSETS]: FS asset service enabled"); | 218 | m_log.Info("[FSASSETS]: FS asset service enabled"); |
@@ -441,7 +449,7 @@ namespace OpenSim.Services.FSAssetService | |||
441 | Store(asset); | 449 | Store(asset); |
442 | } | 450 | } |
443 | } | 451 | } |
444 | if (asset == null) | 452 | if (asset == null && m_showStats) |
445 | { | 453 | { |
446 | // m_log.InfoFormat("[FSASSETS]: Asset {0} not found", id); | 454 | // m_log.InfoFormat("[FSASSETS]: Asset {0} not found", id); |
447 | m_missingAssets++; | 455 | m_missingAssets++; |
@@ -469,8 +477,11 @@ namespace OpenSim.Services.FSAssetService | |||
469 | } | 477 | } |
470 | } | 478 | } |
471 | if (asset == null) | 479 | if (asset == null) |
472 | m_missingAssetsFS++; | 480 | { |
473 | // m_log.InfoFormat("[FSASSETS]: Asset {0}, hash {1} not found in FS", id, hash); | 481 | if (m_showStats) |
482 | m_missingAssetsFS++; | ||
483 | // m_log.InfoFormat("[FSASSETS]: Asset {0}, hash {1} not found in FS", id, hash); | ||
484 | } | ||
474 | else | 485 | else |
475 | { | 486 | { |
476 | // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8) | 487 | // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8) |
@@ -484,10 +495,13 @@ namespace OpenSim.Services.FSAssetService | |||
484 | } | 495 | } |
485 | } | 496 | } |
486 | 497 | ||
487 | lock (m_statsLock) | 498 | if (m_showStats) |
488 | { | 499 | { |
489 | m_readTicks += Environment.TickCount - startTime; | 500 | lock (m_statsLock) |
490 | m_readCount++; | 501 | { |
502 | m_readTicks += Environment.TickCount - startTime; | ||
503 | m_readCount++; | ||
504 | } | ||
491 | } | 505 | } |
492 | 506 | ||
493 | // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8) | 507 | // Deal with bug introduced in Oct. 20 (1eb3e6cc43e2a7b4053bc1185c7c88e22356c5e8) |