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

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/Load__Monitor.java (file contents):
Revision 1.1 by tdb, Thu Mar 22 00:52:48 2001 UTC vs.
Revision 1.2 by ajm, Thu Mar 22 17:57:06 2001 UTC

# Line 32 | Line 32 | public class Load__Monitor extends MonitorSkeleton {
32   //---PUBLIC METHODS---
33  
34      public void analysePacket(XMLPacket packet) {
35        if (packet.getParam("packet.attributes.type").equals("data")) {
36            String source = packet.getParam("packet.attributes.machine_name");
37            if (!_hosts.containsKey(source)) {
38                HashMap attributeRegisters = new HashMap();
39                initAttributeRegsiters(source, attributeRegisters);
40                _hosts.put(source, attributeRegisters);
41            }
35  
36 <            HashMap attributeRegisters = (HashMap) _hosts.get(source);
37 <            for(int attributeNum = 0; attributeNum < _attributes.length; attributeNum++) {
38 <                Register reg = (Register) attributeRegisters.get(_attributes[attributeNum]);
39 <                // find out the threshold level we're at
40 <                String attribute = _attributes[attributeNum];
48 <                String attributeName = _attributeNames[attributeNum];
49 <                String currentValue = packet.getParam(attribute);
50 <                int newThreshold = checkAttributeThreshold(currentValue, reg);
51 <                processAlert(newThreshold, attributeName, reg, source, currentValue);
52 <            }
36 >        String source = packet.getParam("packet.attributes.machine_name");
37 >        if (!_hosts.containsKey(source)) {
38 >            HashMap attributeRegisters = new HashMap();
39 >            initAttributeRegsiters(source, attributeRegisters);
40 >            _hosts.put(source, attributeRegisters);
41          }
42 +
43 +        HashMap attributeRegisters = (HashMap) _hosts.get(source);
44 +        for(int attributeNum = 0; attributeNum < _attributes.length; attributeNum++) {
45 +            Register reg = (Register) attributeRegisters.get(_attributes[attributeNum]);
46 +            // find out the threshold level we're at
47 +            String attribute = _attributes[attributeNum];
48 +            String attributeName = _attributeNames[attributeNum];
49 +            String currentValue = packet.getParam(attribute);
50 +            int newThreshold = checkAttributeThreshold(currentValue, reg);
51 +            processAlert(newThreshold, attributeName, reg, source, currentValue);
52 +        }
53 +
54      }
55  
56      /**
# Line 103 | Line 103 | public class Load__Monitor extends MonitorSkeleton {
103      }
104  
105   //---ACCESSOR/MUTATOR METHODS---
106 +
107 +    protected Queue getQueue() {
108 +        return MonitorManager.getInstance().getDataQueue();
109 +    }
110 +
111  
112   //---ATTRIBUTES---
113  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines