* Implements OSSL function: osGetSimulatorMemory - returns the current amount of memory allocated to the simulator process (Moderate Threat Level).
* Cleans redundant information out of the Simulator Version. Versions now look like: "OpenSimulator 0.6.9(dev) Unix/Mono" * [Minor] additional log info for MySQLInventoryDatamysql-performance
parent
0639e90f56
commit
963cf25813
|
@ -91,6 +91,9 @@ namespace OpenSim.Data.MySQL
|
||||||
rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true";
|
rollbackStore = GridDataMySqlFile.ParseFileReadValue("rollback") == "true";
|
||||||
opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true";
|
opengridmode = GridDataMySqlFile.ParseFileReadValue("opengridmode") == "true";
|
||||||
|
|
||||||
|
if(rollbackStore)
|
||||||
|
m_log.Warn("[MysqlInventory] Enabling rollback mode in: " + rollbackDir);
|
||||||
|
|
||||||
database =
|
database =
|
||||||
new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
|
new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
|
||||||
settingPort);
|
settingPort);
|
||||||
|
|
|
@ -1007,6 +1007,26 @@ namespace OpenSim.Framework
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetRuntimeInformation()
|
||||||
|
{
|
||||||
|
string ru = String.Empty;
|
||||||
|
|
||||||
|
if (Environment.OSVersion.Platform == PlatformID.Unix)
|
||||||
|
ru = "Unix/Mono";
|
||||||
|
else
|
||||||
|
if (Environment.OSVersion.Platform == PlatformID.MacOSX)
|
||||||
|
ru = "OSX/Mono";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Type.GetType("Mono.Runtime") != null)
|
||||||
|
ru = "Win/Mono";
|
||||||
|
else
|
||||||
|
ru = "Win/.NET";
|
||||||
|
}
|
||||||
|
|
||||||
|
return ru;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is the given string a UUID?
|
/// Is the given string a UUID?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -574,10 +574,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
StatsReporter.SetObjectCapacity(objectCapacity);
|
StatsReporter.SetObjectCapacity(objectCapacity);
|
||||||
|
|
||||||
|
// Old
|
||||||
|
/*
|
||||||
m_simulatorVersion = simulatorVersion
|
m_simulatorVersion = simulatorVersion
|
||||||
+ " (OS " + Util.GetOperatingSystemInformation() + ")"
|
+ " (OS " + Util.GetOperatingSystemInformation() + ")"
|
||||||
+ " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString()
|
+ " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString()
|
||||||
+ " PhysPrim:" + m_physicalPrim.ToString();
|
+ " PhysPrim:" + m_physicalPrim.ToString();
|
||||||
|
*/
|
||||||
|
|
||||||
|
m_simulatorVersion = simulatorVersion + " (" + Util.GetRuntimeInformation() + ")";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -1970,5 +1970,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int osGetSimulatorMemory()
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats");
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
long pws = System.Diagnostics.Process.GetCurrentProcess().WorkingSet64;
|
||||||
|
|
||||||
|
if (pws > Int32.MaxValue)
|
||||||
|
return Int32.MaxValue;
|
||||||
|
if (pws < 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return (int)pws;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,5 +163,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
key osGetMapTexture();
|
key osGetMapTexture();
|
||||||
key osGetRegionMapTexture(string regionName);
|
key osGetRegionMapTexture(string regionName);
|
||||||
LSL_List osGetRegionStats();
|
LSL_List osGetRegionStats();
|
||||||
|
|
||||||
|
int osGetSimulatorMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -637,5 +637,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
{
|
{
|
||||||
return m_OSSL_Functions.osGetRegionStats();
|
return m_OSSL_Functions.osGetRegionStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the amount of memory in use by the Simulator Daemon.
|
||||||
|
/// Amount in bytes - if >= 4GB, returns 4GB. (LSL is not 64-bit aware)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public LSL_Integer osGetSimulatorMemory()
|
||||||
|
{
|
||||||
|
return m_OSSL_Functions.osGetSimulatorMemory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue