ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/CPU__Monitor.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/CPU__Monitor.java (file contents):
Revision 1.11 by ajm, Sun Mar 4 02:41:16 2001 UTC vs.
Revision 1.13 by ajm, Sun Mar 4 05:23:41 2001 UTC

# Line 51 | Line 51 | public class CPU__Monitor implements PluginMonitor {
51                  if(reg.getLastThresholdLevel(attributeNum) != Alert.thresholdNORMAL) {
52                      // if the time since the last alert is more than the time for
53                      // its timeout, fire an alert, escalate the alert
54 <                    long timeout = reg.getAlertTimeout(reg.getLastAlertLevel(attributeNum), attributeNum);
54 >                    long timeout = reg.getLastAlertTimeout(attributeNum);
55                      if ((timeout > 0) && (reg.getTimeLastSent(attributeNum) > 0)) {
56                          if((System.currentTimeMillis() - reg.getTimeLastSent(attributeNum)) > timeout) {
57                              reg.escalateAlert(attributeNum);
58                              reg.setTimeLastSent(attributeNum, System.currentTimeMillis());
59 +                            reg.setLastAlertTimeout(attributeNum, reg.getAlertTimeout(reg.getLastAlertLevel(attributeNum), attributeNum));
60                              fireAlert(reg, packet, attributeNum);
61                          }
62                      // if we don't have a timeout configured...we got STRAIGHT to the next level
63                      } else {
64                          reg.escalateAlert(attributeNum);
65                          reg.setTimeLastSent(attributeNum, System.currentTimeMillis());
66 +                        reg.setLastAlertTimeout(attributeNum, reg.getAlertTimeout(reg.getLastAlertLevel(attributeNum), attributeNum));
67                          fireAlert(reg, packet, attributeNum);
68                      }
69                          
# Line 71 | Line 73 | public class CPU__Monitor implements PluginMonitor {
73                      // but if we weren't we only set OK, once the timout of the last
74                      // alert has occourd
75                      if (reg.getLastAlertLevel(attributeNum) != Alert.alertOK) {
76 <                        long timeout = reg.getAlertTimeout(reg.getLastAlertLevel(attributeNum), attributeNum);
76 >                        long timeout = reg.getLastAlertTimeout(attributeNum);
77                          if ((timeout > 0) && (reg.getTimeLastSent(attributeNum) > 0)) {
78                              if ((System.currentTimeMillis() - reg.getTimeLastSent(attributeNum)) > timeout) {
79                                  reg.setLastAlertLevel(attributeNum, Alert.alertOK);
80                                  reg.setTimeLastSent(attributeNum, System.currentTimeMillis());
81 +                                reg.setLastAlertTimeout(attributeNum, timeout);
82                                  fireAlert(reg, packet, attributeNum);
83                              }
81                        } else {
82                            reg.setLastAlertLevel(attributeNum, Alert.alertOK);
83                            reg.setTimeLastSent(attributeNum, System.currentTimeMillis());
84                            fireAlert(reg, packet, attributeNum);
84                          }
85                      }
86                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines