aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/Monitoring/Alerts/DeadlockAlert.cs
diff options
context:
space:
mode:
authorAdam Frisby2009-11-02 00:05:49 +1100
committerAdam Frisby2009-11-02 00:05:49 +1100
commit838bc80ab9273c2834794535886a86c7574bb0d3 (patch)
tree4d352d926fdc8ebfe6e823bbe4ff9eebcc98efed /OpenSim/Region/CoreModules/Framework/Monitoring/Alerts/DeadlockAlert.cs
parent* Implements new 'Monitoring' system for reporting performance. (diff)
downloadopensim-SC_OLD-838bc80ab9273c2834794535886a86c7574bb0d3.zip
opensim-SC_OLD-838bc80ab9273c2834794535886a86c7574bb0d3.tar.gz
opensim-SC_OLD-838bc80ab9273c2834794535886a86c7574bb0d3.tar.bz2
opensim-SC_OLD-838bc80ab9273c2834794535886a86c7574bb0d3.tar.xz
* Implemented some tweaks to monitoring module.
* Output is prettier & more useful. * Added 'Alerts' to allow rules to be constructed using Monitors to detect for events such as deadlocks. This will be translated to SNMP Traps when I get SNMP implemented.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/Monitoring/Alerts/DeadlockAlert.cs')
-rw-r--r--OpenSim/Region/CoreModules/Framework/Monitoring/Alerts/DeadlockAlert.cs37
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 @@
1using OpenSim.Region.CoreModules.Framework.Monitoring.Monitors;
2
3namespace 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}