From ec01936d38f6a082ec7f9d5ba4a07d8150d73ea3 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 3 Dec 2010 02:37:08 +0100 Subject: [PATCH] Change the way sim health reporting reports sim startup --- OpenSim/Region/Framework/Scenes/Scene.cs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 83887b40fc..3c2cd9bdba 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -569,8 +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_lastIncoming = 0; + m_lastOutgoing = 0; m_physicalPrim = physicalPrim; m_seeIntoRegionFromNeighbor = SeeIntoRegionFromNeighbor; @@ -4560,26 +4560,34 @@ namespace OpenSim.Region.Framework.Scenes // 5 = We have seen a new user enter within the past 4 minutes // which can be seen as positive confirmation of sim health // + if (m_firstHeartbeat || (m_lastIncoming == 0 && m_lastOutgoing == 0)) + { + // We're still starting + // 0 means "in startup", it can't happen another way, since + // to get here, we must be able to accept http connections + return 0; + } + int health=1; // Start at 1, means we're up - if (m_firstHeartbeat || ((Util.EnvironmentTickCountSubtract(m_lastUpdate)) < 1000)) + if (Util.EnvironmentTickCountSubtract(m_lastUpdate) < 1000) health+=1; else return health; - if (m_firstHeartbeat || ((Util.EnvironmentTickCountSubtract(m_lastIncoming)) < 1000)) + if (Util.EnvironmentTickCountSubtract(m_lastIncoming) < 1000) health+=1; else return health; - if (m_firstHeartbeat || ((Util.EnvironmentTickCountSubtract(m_lastOutgoing)) < 1000)) + if (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) + if (Util.EnvironmentTickCountSubtract(m_LastLogin) < 240000) health++; else return health;