diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/Monitoring/Alerts/DeadlockAlert.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/Monitoring/Alerts/DeadlockAlert.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Monitoring/Alerts/DeadlockAlert.cs b/OpenSim/Region/CoreModules/Framework/Monitoring/Alerts/DeadlockAlert.cs new file mode 100644 index 0000000..b546ccb --- /dev/null +++ b/OpenSim/Region/CoreModules/Framework/Monitoring/Alerts/DeadlockAlert.cs | |||
@@ -0,0 +1,37 @@ | |||
1 | using OpenSim.Region.CoreModules.Framework.Monitoring.Monitors; | ||
2 | |||
3 | namespace OpenSim.Region.CoreModules.Framework.Monitoring.Alerts | ||
4 | { | ||
5 | class DeadlockAlert : IAlert | ||
6 | { | ||
7 | private LastFrameTimeMonitor m_monitor; | ||
8 | |||
9 | public DeadlockAlert(LastFrameTimeMonitor m_monitor) | ||
10 | { | ||
11 | this.m_monitor = m_monitor; | ||
12 | } | ||
13 | |||
14 | #region Implementation of IAlert | ||
15 | |||
16 | public string GetName() | ||
17 | { | ||
18 | return "Potential Deadlock Alert"; | ||
19 | } | ||
20 | |||
21 | public void Test() | ||
22 | { | ||
23 | if (m_monitor.GetValue() > 60 * 1000) | ||
24 | { | ||
25 | if(OnTriggerAlert != null) | ||
26 | { | ||
27 | OnTriggerAlert(typeof (DeadlockAlert), | ||
28 | (int) (m_monitor.GetValue()/1000) + " second(s) since last frame processed.", true); | ||
29 | } | ||
30 | } | ||
31 | } | ||
32 | |||
33 | public event Alert OnTriggerAlert; | ||
34 | |||
35 | #endregion | ||
36 | } | ||
37 | } | ||