Add scene.<scene-name>.QueuedFetchInventoryRequests stat

This is to aid in detecting whether there are fetch inventory requests remaining to be processed.
0.8.0.3
Justin Clark-Casey (justincc) 2014-03-18 20:10:41 +00:00
parent d5f5649750
commit e82d394ddf
1 changed files with 19 additions and 0 deletions

View File

@ -74,6 +74,8 @@ namespace OpenSim.Region.ClientStack.Linden
/// </remarks>
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;