From e717398f6c72bdb30e59468462f3a5f589c1bb35 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 4 Oct 2012 00:32:42 +0100
Subject: Add experimental "slow frames" stat, available in "show stats" and
via the monitoring module.
This increments a SlowFrames counter if a frame takes over 120% of maximum time.
This commit also introduces a generic OpenSim.Framework.Monitoring.Stat which is available to any code that wants to register a statistic.
This is more granualar than asking objects to create their own reports.
At some point this will supersede earlier IMonitor and IAlert facilities in MonitoringModule which are only available to scene code.
---
.../Region/Framework/Scenes/SimStatsReporter.cs | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 96317c3..b7b5ea2 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -47,6 +47,7 @@ namespace OpenSim.Region.Framework.Scenes
= log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public const string LastReportedObjectUpdateStatName = "LastReportedObjectUpdates";
+ public const string SlowFramesStatName = "SlowFrames";
public delegate void SendStatResult(SimStats stats);
@@ -129,6 +130,16 @@ namespace OpenSim.Region.Framework.Scenes
}
///
+ /// Number of frames that have taken longer to process than Scene.MIN_FRAME_TIME
+ ///
+ public Stat SlowFramesStat { get; private set; }
+
+ ///
+ /// The threshold at which we log a slow frame.
+ ///
+ public int SlowFramesStatReportThreshold { get; private set; }
+
+ ///
/// Extra sim statistics that are used by monitors but not sent to the client.
///
///
@@ -225,6 +236,22 @@ namespace OpenSim.Region.Framework.Scenes
if (StatsManager.SimExtraStats != null)
OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket;
+
+ /// At the moment, we'll only report if a frame is over 120% of target, since commonly frames are a bit
+ /// longer than ideal (which in itself is a concern).
+ SlowFramesStatReportThreshold = (int)Math.Ceiling(m_scene.MinFrameTime * 1000 * 1.2);
+
+ SlowFramesStat
+ = new Stat(
+ "SlowFrames",
+ "Slow Frames",
+ "frames",
+ "scene",
+ m_scene.Name,
+ StatVerbosity.Info,
+ "Number of frames where frame time has been significantly longer than the desired frame time.");
+
+ StatsManager.RegisterStat(SlowFramesStat);
}
public void Close()
@@ -418,6 +445,7 @@ namespace OpenSim.Region.Framework.Scenes
lock (m_lastReportedExtraSimStats)
{
m_lastReportedExtraSimStats[LastReportedObjectUpdateStatName] = m_objectUpdates / m_statsUpdateFactor;
+ m_lastReportedExtraSimStats[SlowFramesStat.ShortName] = (float)SlowFramesStat.Value;
Dictionary physicsStats = m_scene.PhysicsScene.GetStats();
@@ -535,6 +563,11 @@ namespace OpenSim.Region.Framework.Scenes
public void addFrameMS(int ms)
{
m_frameMS += ms;
+
+ // At the moment, we'll only report if a frame is over 120% of target, since commonly frames are a bit
+ // longer than ideal due to the inaccuracy of the Sleep in Scene.Update() (which in itself is a concern).
+ if (ms > SlowFramesStatReportThreshold)
+ SlowFramesStat.Value++;
}
public void AddSpareMS(int ms)
--
cgit v1.1
From 3d36a6d55cb0bba408f5447d4596c12564366030 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 4 Oct 2012 01:27:40 +0100
Subject: Add generic PercentageStat.
Not yet used.
---
OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index b7b5ea2..2addb5b 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -245,7 +245,7 @@ namespace OpenSim.Region.Framework.Scenes
= new Stat(
"SlowFrames",
"Slow Frames",
- "frames",
+ " frames",
"scene",
m_scene.Name,
StatVerbosity.Info,
--
cgit v1.1
From b977f962fab9be0c823b0b3ae9b4777241c9f22c Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 4 Oct 2012 15:20:04 +0200
Subject: Allow default animation to be stopped to be replaced with another
one. Fixes Mantis #6327
---
.../Framework/Scenes/Animation/AnimationSet.cs | 27 ++++++++++++++--------
.../Scenes/Animation/ScenePresenceAnimator.cs | 18 ++++++++++-----
2 files changed, 29 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
index 33041e9..ad421ee 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
{
if (m_defaultAnimation.AnimID == animID)
{
- ResetDefaultAnimation();
+ m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero);
}
else if (HasAnimation(animID))
{
@@ -149,19 +149,26 @@ namespace OpenSim.Region.Framework.Scenes.Animation
{
lock (m_animations)
{
- animIDs = new UUID[m_animations.Count + 1];
- sequenceNums = new int[m_animations.Count + 1];
- objectIDs = new UUID[m_animations.Count + 1];
+ int defaultSize = 0;
+ if (m_defaultAnimation.AnimID != UUID.Zero)
+ defaultSize++;
- animIDs[0] = m_defaultAnimation.AnimID;
- sequenceNums[0] = m_defaultAnimation.SequenceNum;
- objectIDs[0] = m_defaultAnimation.ObjectID;
+ animIDs = new UUID[m_animations.Count + defaultSize];
+ sequenceNums = new int[m_animations.Count + defaultSize];
+ objectIDs = new UUID[m_animations.Count + defaultSize];
+
+ if (m_defaultAnimation.AnimID != UUID.Zero)
+ {
+ animIDs[0] = m_defaultAnimation.AnimID;
+ sequenceNums[0] = m_defaultAnimation.SequenceNum;
+ objectIDs[0] = m_defaultAnimation.ObjectID;
+ }
for (int i = 0; i < m_animations.Count; ++i)
{
- animIDs[i + 1] = m_animations[i].AnimID;
- sequenceNums[i + 1] = m_animations[i].SequenceNum;
- objectIDs[i + 1] = m_animations[i].ObjectID;
+ animIDs[i + defaultSize] = m_animations[i].AnimID;
+ sequenceNums[i + defaultSize] = m_animations[i].SequenceNum;
+ objectIDs[i + defaultSize] = m_animations[i].ObjectID;
}
}
}
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index ff53f45..bb33f07 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -408,13 +408,19 @@ namespace OpenSim.Region.Framework.Scenes.Animation
{
lock (m_animations)
{
- CurrentMovementAnimation = DetermineMovementAnimation();
+ string newMovementAnimation = DetermineMovementAnimation();
+ if (CurrentMovementAnimation != newMovementAnimation)
+ {
+ CurrentMovementAnimation = DetermineMovementAnimation();
-// m_log.DebugFormat(
-// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
-// CurrentMovementAnimation, m_scenePresence.Name);
+// m_log.DebugFormat(
+// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
+// CurrentMovementAnimation, m_scenePresence.Name);
- TrySetMovementAnimation(CurrentMovementAnimation);
+ // Only set it if it's actually changed, give a script
+ // a chance to stop a default animation
+ TrySetMovementAnimation(CurrentMovementAnimation);
+ }
}
}
@@ -536,4 +542,4 @@ namespace OpenSim.Region.Framework.Scenes.Animation
SendAnimPack(animIDs, sequenceNums, objectIDs);
}
}
-}
\ No newline at end of file
+}
--
cgit v1.1
From 03136df1a7f858482ef755d342a33e5b6cfa6ae7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 5 Oct 2012 01:45:49 +0100
Subject: Forgot to actually remove the packetpool set code from scene.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 7 -------
1 file changed, 7 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0a4aa4a..e6b8c16 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -801,13 +801,6 @@ namespace OpenSim.Region.Framework.Scenes
SpawnPointRouting = startupConfig.GetString("SpawnPointRouting", "closest");
TelehubAllowLandmarks = startupConfig.GetBoolean("TelehubAllowLandmark", false);
- IConfig packetConfig = m_config.Configs["PacketPool"];
- if (packetConfig != null)
- {
- PacketPool.Instance.RecyclePackets = packetConfig.GetBoolean("RecyclePackets", true);
- PacketPool.Instance.RecycleDataBlocks = packetConfig.GetBoolean("RecycleDataBlocks", true);
- }
-
m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true);
--
cgit v1.1
From 8cd1dc8d6097d4a5fd1965f9dc2f9f98489f8220 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 5 Oct 2012 02:07:28 +0100
Subject: minor: Add missing license information from the top of
IUserManagement
---
.../Region/Framework/Interfaces/IUserManagement.cs | 29 +++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
index 24cd069..f8088c3 100644
--- a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
+++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs
@@ -1,4 +1,31 @@
-using System;
+/*
+ * Copyright (c) Contributors, http://opensimulator.org/
+ * See CONTRIBUTORS.TXT for a full list of copyright holders.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of the OpenSimulator Project nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+using System;
using System.Collections.Generic;
using OpenMetaverse;
--
cgit v1.1
From 16c9c1dff7bbf299efddd44e4f9aeeb7db38fff6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 6 Oct 2012 02:34:49 +0100
Subject: On receiving TaskInventoryAccepted with a destination folder in the
binary bucket slot for RLV, notify the viewer about inventory folder updates.
The viewer would not see the folder move without this, either on accept or decline.
This commit also updates the TaskInventoryOffered message to better conform with the data LL uses
Changes are, agentID is prim owner rather than prim id, agent name is now simply object name rather than name with owner detail,
message is just folder name in single quotes, message is not timestamped.
However, folder is not renamed "still #RLV/~". Long term solution is probably not to do these operations server-side.
Notes will be added to http://opensimulator.org/mantis/view.php?id=6311
---
OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 3b59dc4..b23ddb4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1424,7 +1424,7 @@ namespace OpenSim.Region.Framework.Scenes
return newFolderID;
}
- private void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems)
+ public void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems)
{
if (folder == null)
return;
--
cgit v1.1