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/Swap__Monitor.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/Swap__Monitor.java (file contents):
Revision 1.5 by ajm, Thu Mar 22 17:57:06 2001 UTC vs.
Revision 1.6 by tdb, Fri Mar 23 02:32:49 2001 UTC

# Line 24 | Line 24 | public class Swap__Monitor extends MonitorSkeleton {
24       */
25      public final String REVISION = "$Revision$";
26      
27 +    /**
28 +     * A description of this monitor
29 +     */
30      public final String DESC = "Monitors Swap.";
31      
32   //---STATIC METHODS---
# Line 31 | Line 34 | public class Swap__Monitor extends MonitorSkeleton {
34   //---CONSTRUCTORS---
35  
36   //---PUBLIC METHODS---
37 <
37 >    
38 >    /**
39 >     * Analyse a packet of data, and generate an alert if
40 >     * necessary.
41 >     *
42 >     * @param packet the XMLPacket to analyse
43 >     */
44      public void analysePacket(XMLPacket packet) {
45          String source = packet.getParam("packet.attributes.machine_name");
46          if (!_hosts.containsKey(source)) {
# Line 97 | Line 106 | public class Swap__Monitor extends MonitorSkeleton {
106      }
107  
108   //---PRIVATE METHODS---
109 <
109 >    
110 >    /**
111 >     * Checks a piece of current data, and returns the
112 >     * threshold it breaches, if any.
113 >     *
114 >     * @param attributeString a String representing the current data value
115 >     * @param reg the Register for the host
116 >     * @return the threshold level breached, if any
117 >     */
118      private int checkAttributeThreshold(double swapInUse, Register reg) {
119          for(int thresholdLevel = Alert.thresholdLevels.length - 1; thresholdLevel >= 0; thresholdLevel--) {
120              if (reg.getThreshold(thresholdLevel) != -1.0) {
# Line 110 | Line 127 | public class Swap__Monitor extends MonitorSkeleton {
127      }
128  
129   //---ACCESSOR/MUTATOR METHODS---
130 <
130 >    
131 >    /**
132 >     * Returns a reference to a specific Queue for this
133 >     * monitor. This Queue returns only the data packets
134 >     * (based on type) that we want too look at.
135 >     *
136 >     * @return a reference to a Queue
137 >     */
138      protected Queue getQueue() {
139          return MonitorManager.getInstance().getDataQueue();
140      }
# Line 130 | Line 154 | public class Swap__Monitor extends MonitorSkeleton {
154      private String _name = "Swap";
155      
156      /**
157 <     * A reference to the configuration proxy in use
157 >     * A HashMap of Registers (or groups of Registers), one
158 >     * for each host we're monitoring.
159       */
135    private ConfigurationProxy _cp = ConfigurationProxy.getInstance();
136
160      private HashMap _hosts = new HashMap();
161  
162   //---STATIC ATTRIBUTES---

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines