diff options
author | Melanie Thielker | 2009-04-15 20:16:18 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-04-15 20:16:18 +0000 |
commit | b018f45b7084da5c859af207ae2968611967647c (patch) | |
tree | 85dea36cdb90ea46bb28acbda38083e005750788 | |
parent | Add a console command facility to the RemoteAdmin plugin. (diff) | |
download | opensim-SC-b018f45b7084da5c859af207ae2968611967647c.zip opensim-SC-b018f45b7084da5c859af207ae2968611967647c.tar.gz opensim-SC-b018f45b7084da5c859af207ae2968611967647c.tar.bz2 opensim-SC-b018f45b7084da5c859af207ae2968611967647c.tar.xz |
Make sim health data more useful
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2ed384f..70713c4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -167,6 +167,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
167 | private Thread HeartbeatThread; | 167 | private Thread HeartbeatThread; |
168 | private volatile bool shuttingdown = false; | 168 | private volatile bool shuttingdown = false; |
169 | 169 | ||
170 | private int m_lastUpdate = Environment.TickCount; | ||
171 | |||
170 | private object m_deleting_scene_object = new object(); | 172 | private object m_deleting_scene_object = new object(); |
171 | 173 | ||
172 | // the minimum time that must elapse before a changed object will be considered for persisted | 174 | // the minimum time that must elapse before a changed object will be considered for persisted |
@@ -787,6 +789,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
787 | private void Heartbeat(object sender) | 789 | private void Heartbeat(object sender) |
788 | { | 790 | { |
789 | Update(); | 791 | Update(); |
792 | |||
793 | m_lastUpdate = Environment.TickCount; | ||
790 | } | 794 | } |
791 | 795 | ||
792 | /// <summary> | 796 | /// <summary> |
@@ -3484,14 +3488,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
3484 | 3488 | ||
3485 | public int GetHealth() | 3489 | public int GetHealth() |
3486 | { | 3490 | { |
3491 | // Returns: | ||
3492 | // 1 = sim is up and accepting http requests. The heartbeat has | ||
3493 | // stopped and the sim is probably locked up, but a remote | ||
3494 | // admin restart may succeed | ||
3495 | // | ||
3496 | // 2 = Sim is up and the heartbeat is running. The sim is likely | ||
3497 | // usable for people within and logins _may_ work | ||
3498 | // | ||
3499 | // 3 = We have seen a new user enter within the past 4 minutes | ||
3500 | // which can be seen as positive confirmation of sim health | ||
3501 | // | ||
3487 | int health=1; // Start at 1, means we're up | 3502 | int health=1; // Start at 1, means we're up |
3488 | 3503 | ||
3504 | if ((Environment.TickCount - m_lastUpdate) < 1000) | ||
3505 | health+=1; | ||
3506 | else | ||
3507 | return health; | ||
3508 | |||
3489 | // A login in the last 4 mins? We can't be doing too badly | 3509 | // A login in the last 4 mins? We can't be doing too badly |
3490 | // | 3510 | // |
3491 | if ((Environment.TickCount - m_LastLogin) < 240000) | 3511 | if ((Environment.TickCount - m_LastLogin) < 240000) |
3492 | health++; | 3512 | health++; |
3513 | else | ||
3514 | return health; | ||
3493 | 3515 | ||
3494 | return 0; | 3516 | return health; |
3495 | } | 3517 | } |
3496 | 3518 | ||
3497 | // This callback allows the PhysicsScene to call back to its caller (the SceneGraph) and | 3519 | // This callback allows the PhysicsScene to call back to its caller (the SceneGraph) and |