From 98d47ea428cd31b302e33dc6015a889d38bcb267 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 18 Jul 2013 17:17:20 -0700 Subject: Delay the enqueueing of non-longpoll requests for 100ms. No need to have these requests actively on the processing queue if it seems they're not ready. --- .../Servers/HttpServer/PollServiceRequestManager.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index e811079..727dbe5 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -96,7 +96,17 @@ namespace OpenSim.Framework.Servers.HttpServer private void ReQueueEvent(PollServiceHttpRequest req) { if (m_running) - m_requests.Enqueue(req); + { + // delay the enqueueing for 100ms. There's no need to have the event + // actively on the queue + Timer t = new Timer(self => { + ((Timer)self).Dispose(); + m_requests.Enqueue(req); + }); + + t.Change(100, Timeout.Infinite); + + } } public void Enqueue(PollServiceHttpRequest req) -- cgit v1.1 From edafea6ae6dd3617520d989fb2fe748e3f0de1b3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 19 Jul 2013 13:17:15 -0700 Subject: PollServiceRequestManager: changed the long poll from a Queue to a List. No need to dequeue and enqueue items every 1sec. --- .../HttpServer/PollServiceRequestManager.cs | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 727dbe5..309b71f 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -47,7 +47,7 @@ namespace OpenSim.Framework.Servers.HttpServer private readonly BaseHttpServer m_server; private BlockingQueue m_requests = new BlockingQueue(); - private static Queue m_longPollRequests = new Queue(); + private static List m_longPollRequests = new List(); private uint m_WorkerThreadCount = 0; private Thread[] m_workerThreads; @@ -116,7 +116,7 @@ namespace OpenSim.Framework.Servers.HttpServer if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LongPoll) { lock (m_longPollRequests) - m_longPollRequests.Enqueue(req); + m_longPollRequests.Add(req); } else m_requests.Enqueue(req); @@ -139,18 +139,21 @@ namespace OpenSim.Framework.Servers.HttpServer List not_ready = new List(); lock (m_longPollRequests) { - while (m_longPollRequests.Count > 0 && m_running) + if (m_longPollRequests.Count > 0 && m_running) { - PollServiceHttpRequest req = m_longPollRequests.Dequeue(); - if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id) || // there are events in this EQ + List ready = m_longPollRequests.FindAll(req => + (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id) || // there are events in this EQ (Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms) // no events, but timeout - m_requests.Enqueue(req); - else - not_ready.Add(req); - } + ); - foreach (PollServiceHttpRequest req in not_ready) - m_longPollRequests.Enqueue(req); + ready.ForEach(req => + { + m_log.DebugFormat("[YYY]: --> Enqueuing"); + m_requests.Enqueue(req); + m_longPollRequests.Remove(req); + }); + + } } } @@ -169,8 +172,8 @@ namespace OpenSim.Framework.Servers.HttpServer lock (m_longPollRequests) { - while (m_longPollRequests.Count > 0 && m_running) - m_requests.Enqueue(m_longPollRequests.Dequeue()); + if (m_longPollRequests.Count > 0 && m_running) + m_longPollRequests.ForEach(req => m_requests.Enqueue(req)); } while (m_requests.Count() > 0) @@ -186,6 +189,7 @@ namespace OpenSim.Framework.Servers.HttpServer } } + m_longPollRequests.Clear(); m_requests.Clear(); } -- cgit v1.1 From 18d5d8f5dd6445e232a571c0e346eb862afcffc3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 19 Jul 2013 13:19:36 -0700 Subject: Removed verbose debug from previous commit --- OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 309b71f..d83daab 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -148,7 +148,6 @@ namespace OpenSim.Framework.Servers.HttpServer ready.ForEach(req => { - m_log.DebugFormat("[YYY]: --> Enqueuing"); m_requests.Enqueue(req); m_longPollRequests.Remove(req); }); -- cgit v1.1 From d5a1779465b6d875ebe5822ce6f15df3378b759f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 20 Jul 2013 12:20:35 -0700 Subject: Manage AgentUpdates more sanely: - The existing event to scene has been split into 2: OnAgentUpdate and OnAgentCameraUpdate, to better reflect the two types of updates that the viewer sends. We can run one without the other, which is what happens when the avie is still but the user is camming around - Added thresholds (as opposed to equality) to determine whether the update is significant or not. I thin these thresholds are ok, but we can play with them later - Ignore updates of HeadRotation, which were problematic and aren't being used up stream --- OpenSim/Framework/IClientAPI.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 65f8395..f39eb0c 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -825,6 +825,8 @@ namespace OpenSim.Framework /// event UpdateAgent OnAgentUpdate; + event UpdateAgent OnAgentCameraUpdate; + event AgentRequestSit OnAgentRequestSit; event AgentSit OnAgentSit; event AvatarPickerRequest OnAvatarPickerRequest; -- cgit v1.1 From b5ab0698d6328c90d779c2af29914da840335233 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 20 Jul 2013 17:58:32 -0700 Subject: EDIT BEAMS!!! They had been missing from OpenSim since ever. Thanks to lkalif for telling me how to route the information. The viewer effect is under the distance filter, so only avatars with cameras < 10m away see the beams. --- OpenSim/Framework/IClientAPI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index f39eb0c..98358e5 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -1476,7 +1476,7 @@ namespace OpenSim.Framework void SendChangeUserRights(UUID agentID, UUID friendID, int rights); void SendTextBoxRequest(string message, int chatChannel, string objectname, UUID ownerID, string ownerFirstName, string ownerLastName, UUID objectId); - void StopFlying(ISceneEntity presence); + void SendAgentTerseUpdate(ISceneEntity presence); void SendPlacesReply(UUID queryID, UUID transactionID, PlacesReplyData[] data); } -- cgit v1.1 From 90528c23d991cd1fc77823be49e4135cf412b92e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 23 Jul 2013 01:13:13 +0100 Subject: For stats which can show average change over time, show the last sample as well as the average. This is somewhat cryptic at the moment, need to improve documentation. --- OpenSim/Framework/Monitoring/Stats/Stat.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index 9629b6e..cc2c947 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs @@ -253,6 +253,8 @@ namespace OpenSim.Framework.Monitoring == MeasuresOfInterest.AverageChangeOverTime) { double totalChange = 0; + double lastChangeOverTime = 0; + double? penultimateSample = null; double? lastSample = null; lock (m_samples) @@ -266,13 +268,21 @@ namespace OpenSim.Framework.Monitoring if (lastSample != null) totalChange += s - (double)lastSample; + penultimateSample = lastSample; lastSample = s; } } + if (lastSample != null && penultimateSample != null) + lastChangeOverTime = (double)lastSample - (double)penultimateSample; + int divisor = m_samples.Count <= 1 ? 1 : m_samples.Count - 1; - sb.AppendFormat(", {0:0.##} {1}/s", totalChange / divisor / (Watchdog.WATCHDOG_INTERVAL_MS / 1000), UnitName); + double averageChangeOverTime = totalChange / divisor / (Watchdog.WATCHDOG_INTERVAL_MS / 1000); + + sb.AppendFormat( + ", {0:0.##} {1}/s, {2:0.##} {3}/s", + lastChangeOverTime, UnitName, averageChangeOverTime, UnitName); } } } -- cgit v1.1 From 76e46d0158461a29e6ef358ba8cb7b7323cc0c05 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 23 Jul 2013 17:23:16 +0100 Subject: Improve spacing between data and units on console stats display --- OpenSim/Framework/Monitoring/Stats/Stat.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index cc2c947..f2329ce 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs @@ -225,7 +225,13 @@ namespace OpenSim.Framework.Monitoring public virtual string ToConsoleString() { StringBuilder sb = new StringBuilder(); - sb.AppendFormat("{0}.{1}.{2} : {3} {4}", Category, Container, ShortName, Value, UnitName); + sb.AppendFormat( + "{0}.{1}.{2} : {3}{4}", + Category, + Container, + ShortName, + Value, + UnitName == null || UnitName == "" ? "" : string.Format(" {0}", UnitName)); AppendMeasuresOfInterest(sb); @@ -281,8 +287,11 @@ namespace OpenSim.Framework.Monitoring double averageChangeOverTime = totalChange / divisor / (Watchdog.WATCHDOG_INTERVAL_MS / 1000); sb.AppendFormat( - ", {0:0.##} {1}/s, {2:0.##} {3}/s", - lastChangeOverTime, UnitName, averageChangeOverTime, UnitName); + ", {0:0.##}{1}/s, {2:0.##}{3}/s", + lastChangeOverTime, + UnitName == null || UnitName == "" ? "" : string.Format(" {0}", UnitName), + averageChangeOverTime, + UnitName == null || UnitName == "" ? "" : string.Format(" {0}", UnitName)); } } } -- cgit v1.1 From 9a4a513b5e4e2496b32113dcffbeeae776eabb89 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 23 Jul 2013 23:31:35 +0100 Subject: Correct issue where the last instance of a sampled stat was shown 3x larger than it should have been (though internal use was correct) --- OpenSim/Framework/Monitoring/Stats/Stat.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Monitoring/Stats/Stat.cs b/OpenSim/Framework/Monitoring/Stats/Stat.cs index f2329ce..ffd5132 100644 --- a/OpenSim/Framework/Monitoring/Stats/Stat.cs +++ b/OpenSim/Framework/Monitoring/Stats/Stat.cs @@ -280,7 +280,8 @@ namespace OpenSim.Framework.Monitoring } if (lastSample != null && penultimateSample != null) - lastChangeOverTime = (double)lastSample - (double)penultimateSample; + lastChangeOverTime + = ((double)lastSample - (double)penultimateSample) / (Watchdog.WATCHDOG_INTERVAL_MS / 1000); int divisor = m_samples.Count <= 1 ? 1 : m_samples.Count - 1; -- cgit v1.1