commit
714c082ca8
|
@ -27,6 +27,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
|
@ -71,6 +72,11 @@ 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;
|
||||
private volatile float m_inUseThreads;
|
||||
|
||||
// /// <summary>
|
||||
// /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
|
||||
|
@ -249,6 +255,10 @@ namespace OpenSim.Framework.Monitoring
|
|||
{
|
||||
// FIXME: SimStats shouldn't allow an arbitrary stat packing order (which is inherited from the original
|
||||
// SimStatsPacket that was being used).
|
||||
|
||||
// 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
|
||||
timeDilation = stats.StatsBlock[0].StatValue;
|
||||
simFps = stats.StatsBlock[1].StatValue;
|
||||
physicsFps = stats.StatsBlock[2].StatValue;
|
||||
|
@ -270,6 +280,11 @@ namespace OpenSim.Framework.Monitoring
|
|||
pendingUploads = stats.StatsBlock[18].StatValue;
|
||||
activeScripts = stats.StatsBlock[19].StatValue;
|
||||
scriptLinesPerSecond = stats.StatsBlock[20].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>
|
||||
|
@ -407,6 +422,27 @@ Asset service request failures: {3}" + Environment.NewLine,
|
|||
/// <returns></returns>
|
||||
public override OSDMap OReport(string uptime, string version)
|
||||
{
|
||||
// Get the amount of physical memory, allocated with the instance of this program, in kilobytes;
|
||||
// the working set is the set of memory pages currently visible to this program in physical RAM
|
||||
// memory and includes both shared (e.g. system libraries) and private data
|
||||
double memUsage = Process.GetCurrentProcess().WorkingSet64 / 1024.0;
|
||||
|
||||
// Get the number of threads from the system that are currently
|
||||
// running
|
||||
int numberThreadsRunning = 0;
|
||||
foreach (ProcessThread currentThread in
|
||||
Process.GetCurrentProcess().Threads)
|
||||
{
|
||||
// A known issue with the current process .Threads property is
|
||||
// that it can return null threads, thus don't count those as
|
||||
// running threads and prevent the program function from failing
|
||||
if (currentThread != null &&
|
||||
currentThread.ThreadState == ThreadState.Running)
|
||||
{
|
||||
numberThreadsRunning++;
|
||||
}
|
||||
}
|
||||
|
||||
OSDMap args = new OSDMap(30);
|
||||
// args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache));
|
||||
// args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}",
|
||||
|
@ -444,6 +480,22 @@ 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["XEngine Thread Count"] = OSD.FromString(String.Format("{0:0.##}",
|
||||
m_inUseThreads));
|
||||
args["Util Thread Count"] = OSD.FromString(String.Format("{0:0.##}",
|
||||
Util.GetSmartThreadPoolInfo().InUseThreads));
|
||||
args["System Thread Count"] = OSD.FromString(String.Format(
|
||||
"{0:0.##}", numberThreadsRunning));
|
||||
args["ProcMem"] = OSD.FromString(String.Format("{0:#,###,###.##}",
|
||||
memUsage));
|
||||
|
||||
return args;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
public const int m_defaultNumberFramesStored = 10;
|
||||
|
||||
public const int m_defaultNumberFramesStored = 10;
|
||||
|
||||
public delegate void SynchronizeSceneHandler(Scene scene);
|
||||
|
||||
#region Fields
|
||||
|
@ -269,7 +271,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);
|
||||
|
@ -528,6 +531,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
get { return m_sceneGraph.PhysicsScene.TimeDilation; }
|
||||
}
|
||||
|
||||
public void setThreadCount(int inUseThreads)
|
||||
{
|
||||
// Just pass the thread count information on its way as the Scene
|
||||
// does not require the value for anything at this time
|
||||
StatsReporter.SetThreadCount(inUseThreads);
|
||||
}
|
||||
|
||||
public SceneCommunicationService SceneGridService
|
||||
{
|
||||
get { return m_sceneGridService; }
|
||||
|
@ -795,12 +805,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
|
||||
|
@ -1109,6 +1121,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
#endregion Interest Management
|
||||
|
||||
// The timer used by the Stopwatch class depends on the system hardware and operating system; inform
|
||||
// if the timer is based on a high-resolution performance counter or based on the system timer;
|
||||
// the performance counter will provide a more precise time than the system timer
|
||||
if (Stopwatch.IsHighResolution)
|
||||
m_log.InfoFormat("[SCENE]: Using high-resolution performance counter for statistics.");
|
||||
else
|
||||
m_log.InfoFormat("[SCENE]: Using system timer for statistics.");
|
||||
|
||||
// Acquire the statistics section of the OpenSim.ini file located
|
||||
// in the bin directory
|
||||
IConfig statisticsConfig = m_config.Configs["Statistics"];
|
||||
|
@ -1136,7 +1156,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;
|
||||
|
@ -1632,7 +1653,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
// These variables will be used to save the precise frame time using the
|
||||
// Stopwatch class of Microsoft SDK; the times are recorded at the start
|
||||
// and end of a particular section of code, and then used to calculate
|
||||
// and end of a parcticular section of code, and then used to calculate
|
||||
// the frame times, which are the sums of the sections for each given name
|
||||
double preciseTotalFrameTime = 0.0;
|
||||
double preciseSimFrameTime = 0.0;
|
||||
|
@ -1670,7 +1691,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// at this point in time, the precise values all begin
|
||||
// with the keyword precise
|
||||
tmpMS = Util.EnvironmentTickCount();
|
||||
|
||||
simFrameStopwatch.Start();
|
||||
UpdateTerrain();
|
||||
|
||||
|
@ -1682,6 +1702,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
terrainMS = Util.EnvironmentTickCountSubtract(tmpMS);
|
||||
}
|
||||
|
||||
// At several points inside the code there was a need to
|
||||
// create a more precise measurement of time elapsed. This
|
||||
// led to the addition of variables that have a similar
|
||||
// function and thus remain tightly connected to their
|
||||
// original counterparts. However, the original code is
|
||||
// not receiving comments from our group because we don't
|
||||
// feel right modifying the code to that degree at this
|
||||
// point in time, the precise values all begin with the
|
||||
// keyword precise
|
||||
|
||||
tmpMS = Util.EnvironmentTickCount();
|
||||
|
||||
// Begin the stopwatch to track the time to prepare physics
|
||||
|
@ -1695,8 +1725,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// enabled will report the time it took to check if physics
|
||||
// was enabled
|
||||
physicsFrameStopwatch.Stop();
|
||||
precisePhysicsFrameTime =
|
||||
physicsFrameStopwatch.Elapsed.TotalMilliseconds;
|
||||
precisePhysicsFrameTime = physicsFrameStopwatch.Elapsed.TotalMilliseconds;
|
||||
physicsMS2 = Util.EnvironmentTickCountSubtract(tmpMS);
|
||||
|
||||
// Apply any pending avatar force input to the avatar's velocity
|
||||
|
@ -1725,11 +1754,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
SynchronizeScene(this);
|
||||
}
|
||||
|
||||
// Add the main physics update time to the prepare physics
|
||||
// time
|
||||
// Add the main physics update time to the prepare physics time
|
||||
physicsFrameStopwatch.Stop();
|
||||
precisePhysicsFrameTime +=
|
||||
physicsFrameStopwatch.Elapsed.TotalMilliseconds;
|
||||
precisePhysicsFrameTime += physicsFrameStopwatch.Elapsed.TotalMilliseconds;
|
||||
physicsMS = Util.EnvironmentTickCountSubtract(tmpMS);
|
||||
|
||||
// Start the stopwatch for the remainder of the simulation
|
||||
|
@ -1887,6 +1914,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
// Finished updating scene frame, so stop the total frame's Stopwatch
|
||||
totalFrameStopwatch.Stop();
|
||||
|
||||
return spareMS >= 0;
|
||||
}
|
||||
|
||||
|
@ -2807,6 +2837,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
bool vialogin;
|
||||
bool reallyNew = true;
|
||||
|
||||
// Update the number of users attempting to login
|
||||
StatsReporter.UpdateUsersLoggingIn(true);
|
||||
|
||||
// Validation occurs in LLUDPServer
|
||||
//
|
||||
// XXX: A race condition exists here where two simultaneous calls to AddNewAgent can interfere with
|
||||
|
@ -2891,6 +2924,10 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
EventManager.TriggerOnClientLogin(client);
|
||||
}
|
||||
|
||||
// User has logged into the scene so update the list of users logging
|
||||
// in
|
||||
StatsReporter.UpdateUsersLoggingIn(false);
|
||||
|
||||
m_LastLogin = Util.EnvironmentTickCount();
|
||||
|
||||
return sp;
|
||||
|
|
|
@ -67,7 +67,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
protected Scene m_parentScene;
|
||||
protected Dictionary<UUID, SceneObjectGroup> m_updateList = new Dictionary<UUID, SceneObjectGroup>();
|
||||
protected int m_numRootAgents = 0;
|
||||
protected int m_numTotalPrim = 0;
|
||||
protected int m_numPrim = 0;
|
||||
protected int m_numMesh = 0;
|
||||
protected int m_numChildAgents = 0;
|
||||
protected int m_physicalPrim = 0;
|
||||
|
||||
|
@ -368,7 +370,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
SceneObjectPart[] parts = sceneObject.Parts;
|
||||
|
||||
// Clamp child prim sizes and add child prims to the m_numPrim count
|
||||
// Clamp the sizes (scales) of the child prims and add the child prims to the count of all primitives
|
||||
// (meshes and geometric primitives) in the scene; add child prims to m_numTotalPrim count
|
||||
if (m_parentScene.m_clampPrimSize)
|
||||
{
|
||||
foreach (SceneObjectPart part in parts)
|
||||
|
@ -382,7 +385,19 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
part.Shape.Scale = scale;
|
||||
}
|
||||
}
|
||||
m_numPrim += parts.Length;
|
||||
m_numTotalPrim += parts.Length;
|
||||
|
||||
// Go through all parts (geometric primitives and meshes) of this Scene Object
|
||||
foreach (SceneObjectPart part in parts)
|
||||
{
|
||||
// Keep track of the total number of meshes or geometric primitives now in the scene;
|
||||
// determine which object this is based on its primitive type: sculpted (sculpt) prim refers to
|
||||
// a mesh and all other prims (i.e. box, sphere, etc) are geometric primitives
|
||||
if (part.GetPrimType() == PrimType.SCULPT)
|
||||
m_numMesh++;
|
||||
else
|
||||
m_numPrim++;
|
||||
}
|
||||
|
||||
sceneObject.AttachToScene(m_parentScene);
|
||||
|
||||
|
@ -437,7 +452,21 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
if (!resultOfObjectLinked)
|
||||
{
|
||||
m_numPrim -= grp.PrimCount;
|
||||
// Decrement the total number of primitives (meshes and geometric primitives)
|
||||
// that are part of the Scene Object being removed
|
||||
m_numTotalPrim -= grp.PrimCount;
|
||||
|
||||
// Go through all parts (primitives and meshes) of this Scene Object
|
||||
foreach (SceneObjectPart part in grp.Parts)
|
||||
{
|
||||
// Keep track of the total number of meshes or geometric primitives left in the scene;
|
||||
// determine which object this is based on its primitive type: sculpted (sculpt) prim refers to
|
||||
// a mesh and all other prims (i.e. box, sphere, etc) are geometric primitives
|
||||
if (part.GetPrimType() == PrimType.SCULPT)
|
||||
m_numMesh--;
|
||||
else
|
||||
m_numPrim--;
|
||||
}
|
||||
|
||||
if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics)
|
||||
RemovePhysicalPrim(grp.PrimCount);
|
||||
|
@ -686,10 +715,20 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
public int GetTotalObjectsCount()
|
||||
{
|
||||
return m_numTotalPrim;
|
||||
}
|
||||
|
||||
public int GetTotalPrimObjectsCount()
|
||||
{
|
||||
return m_numPrim;
|
||||
}
|
||||
|
||||
public int GetTotalMeshObjectsCount()
|
||||
{
|
||||
return m_numMesh;
|
||||
}
|
||||
|
||||
public int GetActiveObjectsCount()
|
||||
{
|
||||
return m_physicalPrim;
|
||||
|
@ -1970,7 +2009,19 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// think it's selected, so it will never send a deselect...
|
||||
copy.IsSelected = false;
|
||||
|
||||
m_numPrim += copy.Parts.Length;
|
||||
m_numTotalPrim += copy.Parts.Length;
|
||||
|
||||
// Go through all parts (primitives and meshes) of this Scene Object
|
||||
foreach (SceneObjectPart part in copy.Parts)
|
||||
{
|
||||
// Keep track of the total number of meshes or geometric primitives now in the scene;
|
||||
// determine which object this is based on its primitive type: sculpted (sculpt) prim refers to
|
||||
// a mesh and all other prims (i.e. box, sphere, etc) are geometric primitives
|
||||
if (part.GetPrimType() == PrimType.SCULPT)
|
||||
m_numMesh++;
|
||||
else
|
||||
m_numPrim++;
|
||||
}
|
||||
|
||||
if (rot != Quaternion.Identity)
|
||||
{
|
||||
|
|
|
@ -61,6 +61,10 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
private YourStatsAreWrong handlerStatsIncorrect;
|
||||
|
||||
// Determines the size of the array that is used to collect StatBlocks
|
||||
// for sending to the SimStats and SimExtraStatsCollector
|
||||
private const int m_statisticArraySize = 27;
|
||||
|
||||
/// <summary>
|
||||
/// These are the IDs of stats sent in the StatsPacket to the viewer.
|
||||
/// </summary>
|
||||
|
@ -104,7 +108,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
ScriptEps = 31,
|
||||
SimSpareMs = 32,
|
||||
SimSleepMs = 33,
|
||||
SimIoPumpTime = 34
|
||||
SimIoPumpTime = 34,
|
||||
FrameDilation = 35,
|
||||
UsersLoggingIn = 36,
|
||||
TotalGeoPrim = 37,
|
||||
TotalMesh = 38,
|
||||
ThreadCount = 39
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -175,7 +184,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
// saved last reported value so there is something available for llGetRegionFPS
|
||||
private float lastReportedSimFPS;
|
||||
private float[] lastReportedSimStats = new float[22];
|
||||
private float[] lastReportedSimStats = new float[m_statisticArraySize];
|
||||
private float m_pfps;
|
||||
|
||||
/// <summary>
|
||||
|
@ -202,6 +211,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
private int m_rootAgents;
|
||||
private int m_childAgents;
|
||||
private int m_numPrim;
|
||||
private int m_numGeoPrim;
|
||||
private int m_numMesh;
|
||||
private int m_inPacketsPerSecond;
|
||||
private int m_outPacketsPerSecond;
|
||||
private int m_activePrim;
|
||||
|
@ -234,6 +245,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// update for physics
|
||||
private int m_numberPhysicsFrames;
|
||||
|
||||
// The current number of users attempting to login to the region
|
||||
private int m_usersLoggingIn;
|
||||
|
||||
// The last reported value of threads from the SmartThreadPool inside of
|
||||
// XEngine
|
||||
private int m_inUseThreads;
|
||||
|
||||
private Scene m_scene;
|
||||
|
||||
private RegionInfo ReportingRegion;
|
||||
|
@ -246,11 +264,13 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
// Initialize the different frame time arrays to the correct sizes
|
||||
m_totalFrameTimeMilliseconds = new double[m_numberFramesStored];
|
||||
m_simulationFrameTimeMilliseconds = new
|
||||
double[m_numberFramesStored];
|
||||
m_simulationFrameTimeMilliseconds = new double[m_numberFramesStored];
|
||||
m_physicsFrameTimeMilliseconds = new double[m_numberFramesStored];
|
||||
m_networkFrameTimeMilliseconds = new double[m_numberFramesStored];
|
||||
|
||||
// Initialize the current number of users logging into the region
|
||||
m_usersLoggingIn = 0;
|
||||
|
||||
m_scene = scene;
|
||||
m_reportedFpsCorrectionFactor = scene.MinFrameSeconds * m_nominalReportedFps;
|
||||
m_statsUpdateFactor = (float)(m_statsUpdatesEveryMS / 1000);
|
||||
|
@ -284,13 +304,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
StatsManager.RegisterStat(SlowFramesStat);
|
||||
}
|
||||
|
||||
|
||||
public SimStatsReporter(Scene scene, int numberOfFrames) : this (scene)
|
||||
{
|
||||
// Store the number of frames from the OpenSim.ini configuration
|
||||
// file
|
||||
// Store the number of frames from the OpenSim.ini configuration file
|
||||
m_numberFramesStored = numberOfFrames;
|
||||
}
|
||||
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_report.Elapsed -= TriggerStatsHeartbeat;
|
||||
|
@ -328,11 +349,17 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
double simulationSumFrameTime;
|
||||
double physicsSumFrameTime;
|
||||
double networkSumFrameTime;
|
||||
float frameDilation;
|
||||
int currentFrame;
|
||||
|
||||
if (!m_scene.Active)
|
||||
return;
|
||||
|
||||
SimStatsPacket.StatBlock[] sb = new SimStatsPacket.StatBlock[22];
|
||||
// Create arrays to hold the statistics for this current scene,
|
||||
// these will be passed to the SimExtraStatsCollector, they are also
|
||||
// sent to the SimStats class
|
||||
SimStatsPacket.StatBlock[] sb = new
|
||||
SimStatsPacket.StatBlock[m_statisticArraySize];
|
||||
SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock();
|
||||
|
||||
// Know what's not thread safe in Mono... modifying timers.
|
||||
|
@ -381,6 +408,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_rootAgents = m_scene.SceneGraph.GetRootAgentCount();
|
||||
m_childAgents = m_scene.SceneGraph.GetChildAgentCount();
|
||||
m_numPrim = m_scene.SceneGraph.GetTotalObjectsCount();
|
||||
m_numGeoPrim = m_scene.SceneGraph.GetTotalPrimObjectsCount();
|
||||
m_numMesh = m_scene.SceneGraph.GetTotalMeshObjectsCount();
|
||||
m_activePrim = m_scene.SceneGraph.GetActiveObjectsCount();
|
||||
m_activeScripts = m_scene.SceneGraph.GetActiveScriptsCount();
|
||||
|
||||
|
@ -406,7 +435,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (framesUpdated == 0)
|
||||
framesUpdated = 1;
|
||||
|
||||
for (int i = 0; i < 22; i++)
|
||||
for (int i = 0; i < m_statisticArraySize; i++)
|
||||
{
|
||||
sb[i] = new SimStatsPacket.StatBlock();
|
||||
}
|
||||
|
@ -431,6 +460,19 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
networkSumFrameTime += m_networkFrameTimeMilliseconds[i];
|
||||
}
|
||||
|
||||
// Get the index that represents the current frame based on the next one known; go back
|
||||
// to the last index if next one is stated to restart at 0
|
||||
if (m_nextLocation == 0)
|
||||
currentFrame = m_numberFramesStored - 1;
|
||||
else
|
||||
currentFrame = m_nextLocation - 1;
|
||||
|
||||
// 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));
|
||||
|
||||
|
@ -459,18 +501,15 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// statistics to the statistics window
|
||||
sb[8].StatID = (uint)Stats.FrameMS;
|
||||
//sb[8].StatValue = m_frameMS / framesUpdated;
|
||||
sb[8].StatValue = (float) totalSumFrameTime /
|
||||
m_numberFramesStored;
|
||||
sb[8].StatValue = (float) totalSumFrameTime / m_numberFramesStored;
|
||||
|
||||
sb[9].StatID = (uint)Stats.NetMS;
|
||||
//sb[9].StatValue = m_netMS / framesUpdated;
|
||||
sb[9].StatValue = (float) networkSumFrameTime /
|
||||
m_numberFramesStored;
|
||||
sb[9].StatValue = (float) networkSumFrameTime / m_numberFramesStored;
|
||||
|
||||
sb[10].StatID = (uint)Stats.PhysicsMS;
|
||||
//sb[10].StatValue = m_physicsMS / framesUpdated;
|
||||
sb[10].StatValue = (float) physicsSumFrameTime /
|
||||
m_numberFramesStored;
|
||||
sb[10].StatValue = (float) physicsSumFrameTime / m_numberFramesStored;
|
||||
|
||||
sb[11].StatID = (uint)Stats.ImageMS ;
|
||||
sb[11].StatValue = m_imageMS / framesUpdated;
|
||||
|
@ -507,7 +546,28 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
sb[21].StatID = (uint)Stats.SimSpareMs;
|
||||
sb[21].StatValue = m_spareMS / framesUpdated;
|
||||
|
||||
for (int i = 0; i < 22; i++)
|
||||
// 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[24].StatID = (uint)Stats.TotalGeoPrim;
|
||||
sb[24].StatValue = m_numGeoPrim;
|
||||
|
||||
// Total number of mesh objects in the scene
|
||||
sb[25].StatID = (uint)Stats.TotalMesh;
|
||||
sb[25].StatValue = m_numMesh;
|
||||
|
||||
// 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++)
|
||||
{
|
||||
lastReportedSimStats[i] = sb[i].StatValue;
|
||||
}
|
||||
|
@ -734,6 +794,31 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
AddunAckedBytes(unAckedBytes);
|
||||
}
|
||||
|
||||
public void UpdateUsersLoggingIn(bool isLoggingIn)
|
||||
{
|
||||
// Determine whether the user has started logging in or has completed
|
||||
// logging into the region
|
||||
if (isLoggingIn)
|
||||
{
|
||||
// The user is starting to login to the region so increment the
|
||||
// number of users attempting to login to the region
|
||||
m_usersLoggingIn++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// The user has finished logging into the region so decrement the
|
||||
// number of users logging into the region
|
||||
m_usersLoggingIn--;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetThreadCount(int inUseThreads)
|
||||
{
|
||||
// Save the new number of threads to our member variable to send to
|
||||
// the extra stats collector
|
||||
m_inUseThreads = inUseThreads;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public Dictionary<string, float> GetExtraSimStats()
|
||||
|
|
|
@ -1872,6 +1872,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
IScriptInstance instance = GetInstance(itemID);
|
||||
if (instance != null)
|
||||
instance.ApiResetScript();
|
||||
|
||||
// Send the new number of threads that are in use by the thread
|
||||
// pool, I believe that by adding them to the locations where the
|
||||
// script is changing states that I will catch all changes to the
|
||||
// thread pool
|
||||
m_Scene.setThreadCount(m_ThreadPool.InUseThreads);
|
||||
}
|
||||
|
||||
public void ResetScript(UUID itemID)
|
||||
|
@ -1879,6 +1885,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
IScriptInstance instance = GetInstance(itemID);
|
||||
if (instance != null)
|
||||
instance.ResetScript(m_WaitForEventCompletionOnScriptStop);
|
||||
|
||||
// Send the new number of threads that are in use by the thread
|
||||
// pool, I believe that by adding them to the locations where the
|
||||
// script is changing states that I will catch all changes to the
|
||||
// thread pool
|
||||
m_Scene.setThreadCount(m_ThreadPool.InUseThreads);
|
||||
}
|
||||
|
||||
public void StartScript(UUID itemID)
|
||||
|
@ -1888,6 +1900,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
instance.Start();
|
||||
else
|
||||
m_runFlags.AddOrUpdate(itemID, true, 240);
|
||||
|
||||
// Send the new number of threads that are in use by the thread
|
||||
// pool, I believe that by adding them to the locations where the
|
||||
// script is changing states that I will catch all changes to the
|
||||
// thread pool
|
||||
m_Scene.setThreadCount(m_ThreadPool.InUseThreads);
|
||||
}
|
||||
|
||||
public void StopScript(UUID itemID)
|
||||
|
@ -1903,6 +1921,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
// m_log.DebugFormat("[XENGINE]: Could not find script with ID {0} to stop in {1}", itemID, World.Name);
|
||||
m_runFlags.AddOrUpdate(itemID, false, 240);
|
||||
}
|
||||
|
||||
// Send the new number of threads that are in use by the thread
|
||||
// pool, I believe that by adding them to the locations where the
|
||||
// script is changing states that I will catch all changes to the
|
||||
// thread pool
|
||||
m_Scene.setThreadCount(m_ThreadPool.InUseThreads);
|
||||
}
|
||||
|
||||
public DetectParams GetDetectParams(UUID itemID, int idx)
|
||||
|
@ -2393,6 +2417,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
instance.Suspend();
|
||||
// else
|
||||
// m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID);
|
||||
|
||||
// Send the new number of threads that are in use by the thread
|
||||
// pool, I believe that by adding them to the locations where the
|
||||
// script is changing states that I will catch all changes to the
|
||||
// thread pool
|
||||
m_Scene.setThreadCount(m_ThreadPool.InUseThreads);
|
||||
}
|
||||
|
||||
public void ResumeScript(UUID itemID)
|
||||
|
@ -2404,6 +2434,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
instance.Resume();
|
||||
// else
|
||||
// m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID);
|
||||
|
||||
// Send the new number of threads that are in use by the thread
|
||||
// pool, I believe that by adding them to the locations where the
|
||||
// script is changing states that I will catch all changes to the
|
||||
// thread pool
|
||||
m_Scene.setThreadCount(m_ThreadPool.InUseThreads);
|
||||
}
|
||||
|
||||
public bool HasScript(UUID itemID, out bool running)
|
||||
|
|
|
@ -296,7 +296,7 @@
|
|||
; Simulator Stats URI
|
||||
; Enable JSON simulator data by setting a URI name (case sensitive)
|
||||
; Returns regular sim stats (SimFPS, ...)
|
||||
; Stats_URI = "jsonSimStats"
|
||||
Stats_URI = "jsonSimStats"
|
||||
|
||||
; Simulator StatsManager URI
|
||||
; Enable fetch of StatsManager registered stats. Fetch is query which can optionally
|
||||
|
|
Loading…
Reference in New Issue