aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2010-12-03 07:27:29 +0100
committerMelanie2010-12-03 07:27:29 +0100
commitb94092517365fd557ca85142d315e746056dcfeb (patch)
treec6160cf37a5b87eb0b6195d5fc2a8e6639320005 /OpenSim/Region/Framework
parentFix health reporting. This will now actually monitor the threads properly (diff)
downloadopensim-SC_OLD-b94092517365fd557ca85142d315e746056dcfeb.zip
opensim-SC_OLD-b94092517365fd557ca85142d315e746056dcfeb.tar.gz
opensim-SC_OLD-b94092517365fd557ca85142d315e746056dcfeb.tar.bz2
opensim-SC_OLD-b94092517365fd557ca85142d315e746056dcfeb.tar.xz
Improve health reporting
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs28
1 files changed, 18 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ec1eda0..d17814d 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4548,7 +4548,7 @@ namespace OpenSim.Region.Framework.Scenes
4548 SimulationDataService.RemoveObject(uuid, m_regInfo.RegionID); 4548 SimulationDataService.RemoveObject(uuid, m_regInfo.RegionID);
4549 } 4549 }
4550 4550
4551 public int GetHealth() 4551 public int GetHealth(out int flags, out string message)
4552 { 4552 {
4553 // Returns: 4553 // Returns:
4554 // 1 = sim is up and accepting http requests. The heartbeat has 4554 // 1 = sim is up and accepting http requests. The heartbeat has
@@ -4567,6 +4567,12 @@ namespace OpenSim.Region.Framework.Scenes
4567 // 5 = We have seen a new user enter within the past 4 minutes 4567 // 5 = We have seen a new user enter within the past 4 minutes
4568 // which can be seen as positive confirmation of sim health 4568 // which can be seen as positive confirmation of sim health
4569 // 4569 //
4570
4571 flags = 0;
4572 message = String.Empty;
4573
4574 CheckHeartbeat();
4575
4570 if (m_firstHeartbeat || (m_lastIncoming == 0 && m_lastOutgoing == 0)) 4576 if (m_firstHeartbeat || (m_lastIncoming == 0 && m_lastOutgoing == 0))
4571 { 4577 {
4572 // We're still starting 4578 // We're still starting
@@ -4578,28 +4584,30 @@ namespace OpenSim.Region.Framework.Scenes
4578 int health=1; // Start at 1, means we're up 4584 int health=1; // Start at 1, means we're up
4579 4585
4580 if (Util.EnvironmentTickCountSubtract(m_lastUpdate) < 1000) 4586 if (Util.EnvironmentTickCountSubtract(m_lastUpdate) < 1000)
4587 {
4581 health+=1; 4588 health+=1;
4582 else 4589 flags |= 1;
4583 return health; 4590 }
4584 4591
4585 if (Util.EnvironmentTickCountSubtract(m_lastIncoming) < 1000) 4592 if (Util.EnvironmentTickCountSubtract(m_lastIncoming) < 1000)
4593 {
4586 health+=1; 4594 health+=1;
4587 else 4595 flags |= 2;
4588 return health; 4596 }
4589 4597
4590 if (Util.EnvironmentTickCountSubtract(m_lastOutgoing) < 1000) 4598 if (Util.EnvironmentTickCountSubtract(m_lastOutgoing) < 1000)
4599 {
4591 health+=1; 4600 health+=1;
4592 else 4601 flags |= 4;
4602 }
4603
4604 if (flags != 7)
4593 return health; 4605 return health;
4594 4606
4595 // A login in the last 4 mins? We can't be doing too badly 4607 // A login in the last 4 mins? We can't be doing too badly
4596 // 4608 //
4597 if (Util.EnvironmentTickCountSubtract(m_LastLogin) < 240000) 4609 if (Util.EnvironmentTickCountSubtract(m_LastLogin) < 240000)
4598 health++; 4610 health++;
4599 else
4600 return health;
4601
4602 CheckHeartbeat();
4603 4611
4604 return health; 4612 return health;
4605 } 4613 }