diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index f0dccda168..2544c7fe77 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs @@ -74,6 +74,8 @@ namespace OpenSim.Region.ClientStack.Linden /// public bool ProcessQueuedRequestsAsync { get; private set; } + private Stat m_queuedRequestsStat; + private Scene m_scene; private IInventoryService m_InventoryService; @@ -130,6 +132,8 @@ namespace OpenSim.Region.ClientStack.Linden m_scene.EventManager.OnRegisterCaps -= RegisterCaps; + StatsManager.DeregisterStat(m_queuedRequestsStat); + if (ProcessQueuedRequestsAsync) { if (m_workerThreads != null) @@ -149,6 +153,21 @@ namespace OpenSim.Region.ClientStack.Linden if (!m_Enabled) return; + m_queuedRequestsStat = + new Stat( + "QueuedFetchInventoryRequests", + "Number of fetch inventory requests queued for processing", + "", + "", + "scene", + m_scene.Name, + StatType.Pull, + MeasuresOfInterest.AverageChangeOverTime, + stat => { lock (m_queue) { stat.Value = m_queue.Count; } }, + StatVerbosity.Debug); + + StatsManager.RegisterStat(m_queuedRequestsStat); + m_InventoryService = m_scene.InventoryService; m_LibraryService = m_scene.LibraryService;