Add scene.<scene-name>.ProcessedFetchInventoryRequests
This shows the number of requests that have been processed. These have not necessarily been sent back to the request since this is done separately by the PollServiceRequestManager0.8.0.3
parent
8ce3fa646b
commit
a660c0a750
|
@ -74,9 +74,18 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
/// </remarks>
|
||||
public bool ProcessQueuedRequestsAsync { get; private set; }
|
||||
|
||||
private Stat m_queuedRequestsStat;
|
||||
/// <summary>
|
||||
/// Number of inventory requests processed by this module.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It's the PollServiceRequestManager that actually sends completed requests back to the requester.
|
||||
/// </remarks>
|
||||
public int ProcessedRequestsCount { get; set; }
|
||||
|
||||
private Scene m_scene;
|
||||
private Stat m_queuedRequestsStat;
|
||||
private Stat m_processedRequestsStat;
|
||||
|
||||
public Scene Scene { get; private set; }
|
||||
|
||||
private IInventoryService m_InventoryService;
|
||||
private ILibraryService m_LibraryService;
|
||||
|
@ -122,7 +131,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
m_scene = s;
|
||||
Scene = s;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene s)
|
||||
|
@ -130,8 +139,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
|
||||
Scene.EventManager.OnRegisterCaps -= RegisterCaps;
|
||||
|
||||
StatsManager.DeregisterStat(m_processedRequestsStat);
|
||||
StatsManager.DeregisterStat(m_queuedRequestsStat);
|
||||
|
||||
if (ProcessQueuedRequestsAsync)
|
||||
|
@ -145,7 +155,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
}
|
||||
}
|
||||
|
||||
m_scene = null;
|
||||
Scene = null;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene s)
|
||||
|
@ -153,6 +163,19 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
m_processedRequestsStat =
|
||||
new Stat(
|
||||
"ProcessedFetchInventoryRequests",
|
||||
"Number of processed fetch inventory requests",
|
||||
"These have not necessarily yet been dispatched back to the requester.",
|
||||
"",
|
||||
"scene",
|
||||
Scene.Name,
|
||||
StatType.Pull,
|
||||
MeasuresOfInterest.AverageChangeOverTime,
|
||||
stat => { lock (m_queue) { stat.Value = ProcessedRequestsCount; } },
|
||||
StatVerbosity.Debug);
|
||||
|
||||
m_queuedRequestsStat =
|
||||
new Stat(
|
||||
"QueuedFetchInventoryRequests",
|
||||
|
@ -160,21 +183,22 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
"",
|
||||
"",
|
||||
"scene",
|
||||
m_scene.Name,
|
||||
Scene.Name,
|
||||
StatType.Pull,
|
||||
MeasuresOfInterest.AverageChangeOverTime,
|
||||
stat => { lock (m_queue) { stat.Value = m_queue.Count; } },
|
||||
StatVerbosity.Debug);
|
||||
|
||||
StatsManager.RegisterStat(m_processedRequestsStat);
|
||||
StatsManager.RegisterStat(m_queuedRequestsStat);
|
||||
|
||||
m_InventoryService = m_scene.InventoryService;
|
||||
m_LibraryService = m_scene.LibraryService;
|
||||
m_InventoryService = Scene.InventoryService;
|
||||
m_LibraryService = Scene.LibraryService;
|
||||
|
||||
// We'll reuse the same handler for all requests.
|
||||
m_webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
|
||||
|
||||
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
|
||||
Scene.EventManager.OnRegisterCaps += RegisterCaps;
|
||||
|
||||
if (ProcessQueuedRequestsAsync && m_workerThreads == null)
|
||||
{
|
||||
|
@ -215,12 +239,12 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
private Dictionary<UUID, Hashtable> responses =
|
||||
new Dictionary<UUID, Hashtable>();
|
||||
|
||||
private Scene m_scene;
|
||||
private WebFetchInvDescModule m_module;
|
||||
|
||||
public PollServiceInventoryEventArgs(Scene scene, string url, UUID pId) :
|
||||
public PollServiceInventoryEventArgs(WebFetchInvDescModule module, string url, UUID pId) :
|
||||
base(null, url, null, null, null, pId, int.MaxValue)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_module = module;
|
||||
|
||||
HasEvents = (x, y) => { lock (responses) return responses.ContainsKey(x); };
|
||||
GetEvents = (x, y) =>
|
||||
|
@ -240,7 +264,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
|
||||
Request = (x, y) =>
|
||||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(Id);
|
||||
ScenePresence sp = m_module.Scene.GetScenePresence(Id);
|
||||
if (sp == null)
|
||||
{
|
||||
m_log.ErrorFormat("[INVENTORY]: Unable to find ScenePresence for {0}", Id);
|
||||
|
@ -340,6 +364,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
|
||||
lock (responses)
|
||||
responses[requestID] = response;
|
||||
|
||||
m_module.ProcessedRequestsCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -363,7 +389,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
capUrl = "/CAPS/" + UUID.Random() + "/";
|
||||
|
||||
// Register this as a poll service
|
||||
PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(m_scene, capUrl, agentID);
|
||||
PollServiceInventoryEventArgs args = new PollServiceInventoryEventArgs(this, capUrl, agentID);
|
||||
args.Type = PollServiceEventArgs.EventType.Inventory;
|
||||
|
||||
caps.RegisterPollHandler(capName, args);
|
||||
|
@ -372,7 +398,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
|||
else
|
||||
{
|
||||
capUrl = url;
|
||||
IExternalCapsModule handler = m_scene.RequestModuleInterface<IExternalCapsModule>();
|
||||
IExternalCapsModule handler = Scene.RequestModuleInterface<IExternalCapsModule>();
|
||||
if (handler != null)
|
||||
handler.RegisterExternalUserCapsHandler(agentID,caps,capName,capUrl);
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue