Phase 2 additons with Frame Dilation metric.
parent
1959eb8372
commit
c3138f9f38
|
@ -72,6 +72,7 @@ namespace OpenSim.Framework.Monitoring
|
|||
private volatile float pendingUploads;
|
||||
private volatile float activeScripts;
|
||||
private volatile float scriptLinesPerSecond;
|
||||
private volatile float m_frameDilation;
|
||||
private volatile float m_usersLoggingIn;
|
||||
private volatile float m_totalGeoPrims;
|
||||
private volatile float m_totalMeshes;
|
||||
|
@ -257,7 +258,7 @@ namespace OpenSim.Framework.Monitoring
|
|||
|
||||
// For an unknown reason the original designers decided not to
|
||||
// include the spare MS statistic inside of this class, this is
|
||||
// located inside the StatsBlock at location 21 thus it is skipped
|
||||
// located inside the StatsBlock at location 21, thus it is skipped
|
||||
timeDilation = stats.StatsBlock[0].StatValue;
|
||||
simFps = stats.StatsBlock[1].StatValue;
|
||||
physicsFps = stats.StatsBlock[2].StatValue;
|
||||
|
@ -279,10 +280,11 @@ namespace OpenSim.Framework.Monitoring
|
|||
pendingUploads = stats.StatsBlock[18].StatValue;
|
||||
activeScripts = stats.StatsBlock[19].StatValue;
|
||||
scriptLinesPerSecond = stats.StatsBlock[20].StatValue;
|
||||
m_usersLoggingIn = stats.StatsBlock[22].StatValue;
|
||||
m_totalGeoPrims = stats.StatsBlock[23].StatValue;
|
||||
m_totalMeshes = stats.StatsBlock[24].StatValue;
|
||||
m_inUseThreads = stats.StatsBlock[25].StatValue;
|
||||
m_frameDilation = stats.StatsBlock[22].StatValue;
|
||||
m_usersLoggingIn = stats.StatsBlock[23].StatValue;
|
||||
m_totalGeoPrims = stats.StatsBlock[24].StatValue;
|
||||
m_totalMeshes = stats.StatsBlock[25].StatValue;
|
||||
m_inUseThreads = stats.StatsBlock[26].StatValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -474,14 +476,13 @@ Asset service request failures: {3}" + Environment.NewLine,
|
|||
args["Uptime"] = OSD.FromString (uptime);
|
||||
args["Version"] = OSD.FromString (version);
|
||||
|
||||
args["FrameDilatn"] = OSD.FromString(String.Format("{0:0.##}", m_frameDilation));
|
||||
args["Logging in Users"] = OSD.FromString(String.Format("{0:0.##}",
|
||||
m_usersLoggingIn));
|
||||
args["GeoPrims"] = OSD.FromString(String.Format("{0:0.##}",
|
||||
m_totalGeoPrims));
|
||||
args["Mesh Objects"] = OSD.FromString(String.Format("{0:0.##}",
|
||||
m_totalMeshes));
|
||||
args["Polygon Count"] = OSD.FromString(String.Format("{0:0.##}", 0));
|
||||
args["Texture Count"] = OSD.FromString(String.Format("{0:0.##}", 0));
|
||||
args["XEngine Thread Count"] = OSD.FromString(String.Format("{0:0.##}",
|
||||
m_inUseThreads));
|
||||
args["Util Thread Count"] = OSD.FromString(String.Format("{0:0.##}",
|
||||
|
|
|
@ -267,7 +267,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
public float DefaultDrawDistance
|
||||
{
|
||||
// get { return m_defaultDrawDistance; }
|
||||
get {
|
||||
get
|
||||
{
|
||||
if (RegionInfo != null)
|
||||
{
|
||||
float largestDimension = Math.Max(RegionInfo.RegionSizeX, RegionInfo.RegionSizeY);
|
||||
|
@ -800,12 +801,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// can be closest/random/sequence
|
||||
public string SpawnPointRouting
|
||||
{
|
||||
get; private set;
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
// allow landmarks to pass
|
||||
public bool TelehubAllowLandmarks
|
||||
{
|
||||
get; private set;
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
#endregion Properties
|
||||
|
@ -1148,7 +1151,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
}
|
||||
|
||||
public Scene(RegionInfo regInfo, PhysicsScene physicsScene) : base(regInfo)
|
||||
public Scene(RegionInfo regInfo, PhysicsScene physicsScene)
|
||||
: base(regInfo)
|
||||
{
|
||||
m_sceneGraph = new SceneGraph(this);
|
||||
m_sceneGraph.PhysicsScene = physicsScene;
|
||||
|
@ -1673,7 +1677,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (Frame % m_update_terrain == 0)
|
||||
{
|
||||
tmpMS = Util.EnvironmentTickCount();
|
||||
simFrameStopwatch.Start();
|
||||
UpdateTerrain();
|
||||
|
||||
// Get the simulation frame time that the avatar force
|
||||
// input took
|
||||
simFrameStopwatch.Stop();
|
||||
preciseSimFrameTime =
|
||||
simFrameStopwatch.Elapsed.TotalMilliseconds;
|
||||
terrainMS = Util.EnvironmentTickCountSubtract(tmpMS);
|
||||
}
|
||||
|
||||
|
@ -1705,13 +1716,15 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
// Apply any pending avatar force input to the avatar's velocity
|
||||
tmpMS = Util.EnvironmentTickCount();
|
||||
simFrameStopwatch.Start();
|
||||
simFrameStopwatch.Restart();
|
||||
if (Frame % m_update_entitymovement == 0)
|
||||
m_sceneGraph.UpdateScenePresenceMovement();
|
||||
|
||||
// Get the simulation frame time that the avatar force input took
|
||||
// Get the simulation frame time that the avatar force input
|
||||
// took
|
||||
simFrameStopwatch.Stop();
|
||||
preciseSimFrameTime = simFrameStopwatch.Elapsed.TotalMilliseconds;
|
||||
preciseSimFrameTime +=
|
||||
simFrameStopwatch.Elapsed.TotalMilliseconds;
|
||||
agentMS = Util.EnvironmentTickCountSubtract(tmpMS);
|
||||
|
||||
// Perform the main physics update. This will do the actual work of moving objects and avatars according to their
|
||||
|
@ -1821,6 +1834,11 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
EventManager.TriggerRegionHeartbeatEnd(this);
|
||||
otherMS = eventMS + backupMS + terrainMS + landMS;
|
||||
|
||||
// Get the elapsed time for the simulation frame
|
||||
simFrameStopwatch.Stop();
|
||||
preciseSimFrameTime +=
|
||||
simFrameStopwatch.Elapsed.TotalMilliseconds;
|
||||
|
||||
if (!UpdateOnTimer)
|
||||
{
|
||||
Watchdog.UpdateThread();
|
||||
|
@ -1837,9 +1855,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
spareMS = Math.Max(0, MinFrameTicks - physicsMS2 - agentMS - physicsMS - otherMS);
|
||||
}
|
||||
|
||||
// Get the elapsed time for the simulation frame
|
||||
simFrameStopwatch.Stop();
|
||||
preciseSimFrameTime += simFrameStopwatch.Elapsed.TotalMilliseconds;
|
||||
// Get the total frame time
|
||||
totalFrameStopwatch.Stop();
|
||||
preciseTotalFrameTime =
|
||||
totalFrameStopwatch.Elapsed.TotalMilliseconds;
|
||||
|
||||
// Restart the stopwatch for the total time of the next frame
|
||||
totalFrameStopwatch.Restart();
|
||||
|
||||
previousFrameTick = m_lastFrameTick;
|
||||
frameMS = Util.EnvironmentTickCountSubtract(m_lastFrameTick);
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
// Determines the size of the array that is used to collect StatBlocks
|
||||
// for sending to the SimStats and SimExtraStatsCollector
|
||||
private const int m_statisticArraySize = 26;
|
||||
private const int m_statisticArraySize = 27;
|
||||
|
||||
/// <summary>
|
||||
/// These are the IDs of stats sent in the StatsPacket to the viewer.
|
||||
|
@ -109,10 +109,11 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
SimSpareMs = 32,
|
||||
SimSleepMs = 33,
|
||||
SimIoPumpTime = 34,
|
||||
UsersLoggingIn = 35,
|
||||
TotalGeoPrim = 36,
|
||||
TotalMesh = 37,
|
||||
ThreadCount = 38
|
||||
FrameDilation = 35,
|
||||
UsersLoggingIn = 36,
|
||||
TotalGeoPrim = 37,
|
||||
TotalMesh = 38,
|
||||
ThreadCount = 39
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -348,7 +349,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
double simulationSumFrameTime;
|
||||
double physicsSumFrameTime;
|
||||
double networkSumFrameTime;
|
||||
float timeDilation;
|
||||
float frameDilation;
|
||||
int currentFrame;
|
||||
|
||||
if (!m_scene.Active)
|
||||
|
@ -466,16 +467,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
else
|
||||
currentFrame = m_nextLocation - 1;
|
||||
|
||||
// Calculate the time dilation; which is currently based on the ratio between the sum of the
|
||||
// physics and simulation rate, and the set minimum time to run the scene's update; minFrameTime
|
||||
// is given in seconds so multiply by 1000 to convert it to milliseconds
|
||||
timeDilation = (float)(m_simulationFrameTimeMilliseconds[currentFrame] +
|
||||
m_physicsFrameTimeMilliseconds[currentFrame]) / (m_scene.MinFrameTime * 1000);
|
||||
// Calculate the frame dilation; which is currently based on the ratio between the sum of the
|
||||
// physics and simulation rate, and the set minimum time to run a scene's frame
|
||||
frameDilation = (float)(m_simulationFrameTimeMilliseconds[currentFrame] +
|
||||
m_physicsFrameTimeMilliseconds[currentFrame]) / m_scene.MinFrameTicks;
|
||||
|
||||
// ORIGINAL code commented out until we have time to add our own
|
||||
sb[0].StatID = (uint) Stats.TimeDilation;
|
||||
//sb[0].StatValue = (Single.IsNaN(m_timeDilation)) ? 0.1f : m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor));
|
||||
sb[0].StatValue = timeDilation;
|
||||
sb[0].StatValue = (Single.IsNaN(m_timeDilation)) ? 0.1f : m_timeDilation ; //((((m_timeDilation + (0.10f * statsUpdateFactor)) /10) / statsUpdateFactor));
|
||||
|
||||
sb[1].StatID = (uint) Stats.SimFPS;
|
||||
sb[1].StatValue = reportedFPS / m_statsUpdateFactor;
|
||||
|
@ -547,23 +546,26 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
sb[21].StatID = (uint)Stats.SimSpareMs;
|
||||
sb[21].StatValue = m_spareMS / framesUpdated;
|
||||
|
||||
// Added to track the number of users currently attempting to
|
||||
// login to the region
|
||||
sb[22].StatID = (uint)Stats.UsersLoggingIn;
|
||||
sb[22].StatValue = m_usersLoggingIn;
|
||||
// Current ratio between the sum of physics and sim rate, and the
|
||||
// minimum time to run a scene's frame
|
||||
sb[22].StatID = (uint)Stats.FrameDilation;
|
||||
sb[22].StatValue = frameDilation;
|
||||
|
||||
// Current number of users currently attemptint to login to region
|
||||
sb[23].StatID = (uint)Stats.UsersLoggingIn;
|
||||
sb[23].StatValue = m_usersLoggingIn;
|
||||
|
||||
// Total number of geometric primitives in the scene
|
||||
sb[23].StatID = (uint)Stats.TotalGeoPrim;
|
||||
sb[23].StatValue = m_numGeoPrim;
|
||||
sb[24].StatID = (uint)Stats.TotalGeoPrim;
|
||||
sb[24].StatValue = m_numGeoPrim;
|
||||
|
||||
// Total number of mesh objects in the scene
|
||||
sb[24].StatID = (uint)Stats.TotalMesh;
|
||||
sb[24].StatValue = m_numMesh;
|
||||
sb[25].StatID = (uint)Stats.TotalMesh;
|
||||
sb[25].StatValue = m_numMesh;
|
||||
|
||||
// Added to track the current number of threads that XEngine is
|
||||
// using
|
||||
sb[25].StatID = (uint)Stats.ThreadCount;
|
||||
sb[25].StatValue = m_inUseThreads;
|
||||
// Current number of threads that XEngine is using
|
||||
sb[26].StatID = (uint)Stats.ThreadCount;
|
||||
sb[26].StatValue = m_inUseThreads;
|
||||
|
||||
for (int i = 0; i < m_statisticArraySize; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue