diff options
author | Melanie | 2010-12-03 07:27:29 +0100 |
---|---|---|
committer | Melanie | 2010-12-03 07:27:29 +0100 |
commit | b94092517365fd557ca85142d315e746056dcfeb (patch) | |
tree | c6160cf37a5b87eb0b6195d5fc2a8e6639320005 /OpenSim | |
parent | Fix health reporting. This will now actually monitor the threads properly (diff) | |
download | opensim-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')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 28 |
2 files changed, 23 insertions, 11 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index f3f79bc..a75cc60 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -2632,8 +2632,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2632 | else throw new Exception("neither region_name nor region_uuid given"); | 2632 | else throw new Exception("neither region_name nor region_uuid given"); |
2633 | 2633 | ||
2634 | Scene scene = m_application.SceneManager.CurrentScene; | 2634 | Scene scene = m_application.SceneManager.CurrentScene; |
2635 | int health = scene.GetHealth(); | 2635 | int flags; |
2636 | string text; | ||
2637 | int health = scene.GetHealth(out flags, out text); | ||
2636 | responseData["health"] = health; | 2638 | responseData["health"] = health; |
2639 | responseData["flags"] = health; | ||
2640 | responseData["message"] = health; | ||
2637 | 2641 | ||
2638 | response.Value = responseData; | 2642 | response.Value = responseData; |
2639 | } | 2643 | } |
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 | } |