diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 59968a1107..ef0a178448 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -946,6 +946,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP while (base.IsRunning) { + m_scene.ThreadAlive(1); try { IncomingPacket incomingPacket = null; @@ -988,6 +989,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP while (base.IsRunning) { + m_scene.ThreadAlive(2); try { m_packetSent = false; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 216eb51e3a..83887b40fc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -174,6 +174,8 @@ namespace OpenSim.Region.Framework.Scenes private volatile bool shuttingdown; private int m_lastUpdate; + private int m_lastIncoming; + private int m_lastOutgoing; private bool m_firstHeartbeat = true; private object m_deleting_scene_object = new object(); @@ -567,6 +569,8 @@ namespace OpenSim.Region.Framework.Scenes m_regionName = m_regInfo.RegionName; m_datastore = m_regInfo.DataStore; m_lastUpdate = Util.EnvironmentTickCount(); + m_lastIncoming = Util.EnvironmentTickCount(); + m_lastOutgoing = Util.EnvironmentTickCount(); m_physicalPrim = physicalPrim; m_seeIntoRegionFromNeighbor = SeeIntoRegionFromNeighbor; @@ -4543,11 +4547,17 @@ namespace OpenSim.Region.Framework.Scenes // 1 = sim is up and accepting http requests. The heartbeat has // stopped and the sim is probably locked up, but a remote // admin restart may succeed - // + // // 2 = Sim is up and the heartbeat is running. The sim is likely - // usable for people within and logins _may_ work + // usable for people within // - // 3 = We have seen a new user enter within the past 4 minutes + // 3 = Sim is up and one packet thread is running. Sim is + // unstable and will not accept new logins + // + // 4 = Sim is up and both packet threads are running. Sim is + // likely usable + // + // 5 = We have seen a new user enter within the past 4 minutes // which can be seen as positive confirmation of sim health // int health=1; // Start at 1, means we're up @@ -4557,6 +4567,16 @@ namespace OpenSim.Region.Framework.Scenes else return health; + if (m_firstHeartbeat || ((Util.EnvironmentTickCountSubtract(m_lastIncoming)) < 1000)) + health+=1; + else + return health; + + if (m_firstHeartbeat || ((Util.EnvironmentTickCountSubtract(m_lastOutgoing)) < 1000)) + health+=1; + else + return health; + // A login in the last 4 mins? We can't be doing too badly // if ((Util.EnvironmentTickCountSubtract(m_LastLogin)) < 240000) @@ -5106,5 +5126,18 @@ namespace OpenSim.Region.Framework.Scenes m_log.Debug("[SCENE]: Finished dropped attachment deletion"); } } + + public void ThreadAlive(int threadCode) + { + switch(threadCode) + { + case 1: // Incoming + m_lastIncoming = Util.EnvironmentTickCount(); + break; + case 2: // Incoming + m_lastOutgoing = Util.EnvironmentTickCount(); + break; + } + } } }