From e82d394ddf8eacf3afe9c66858c0186d2af295ef Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 18 Mar 2014 20:10:41 +0000 Subject: Add scene..QueuedFetchInventoryRequests stat This is to aid in detecting whether there are fetch inventory requests remaining to be processed. --- .../ClientStack/Linden/Caps/WebFetchInvDescModule.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/WebFetchInvDescModule.cs index f0dccda..2544c7f 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; -- cgit v1.1