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.21 by tdb, Thu Mar 22 00:52:48 2001 UTC vs.
Revision 1.22 by ajm, Thu Mar 22 17:57:05 2001 UTC

# Line 32 | Line 32 | public class CPU__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 >        String source = packet.getParam("packet.attributes.machine_name");
36 >        if (!_hosts.containsKey(source)) {
37 >            HashMap attributeRegisters = new HashMap();
38 >            initAttributeRegsiters(source, attributeRegisters);
39 >            _hosts.put(source, attributeRegisters);
40 >        }
41  
42 <            HashMap attributeRegisters = (HashMap) _hosts.get(source);
43 <            for(int attributeNum = 0; attributeNum < _attributes.length; attributeNum++) {
44 <                Register reg = (Register) attributeRegisters.get(_attributes[attributeNum]);
45 <                // find out the threshold level we're at
46 <                String attribute = _attributes[attributeNum];
47 <                String attributeName = _attributeNames[attributeNum];
48 <                String currentValue = packet.getParam(attribute);
49 <                int newThreshold = checkAttributeThreshold(currentValue, reg);
50 <                processAlert(newThreshold, attributeName, reg, source, currentValue);
52 <            }
42 >        HashMap attributeRegisters = (HashMap) _hosts.get(source);
43 >        for(int attributeNum = 0; attributeNum < _attributes.length; attributeNum++) {
44 >            Register reg = (Register) attributeRegisters.get(_attributes[attributeNum]);
45 >            // find out the threshold level we're at
46 >            String attribute = _attributes[attributeNum];
47 >            String attributeName = _attributeNames[attributeNum];
48 >            String currentValue = packet.getParam(attribute);
49 >            int newThreshold = checkAttributeThreshold(currentValue, reg);
50 >            processAlert(newThreshold, attributeName, reg, source, currentValue);
51          }
52      }
53  
# Line 103 | Line 101 | public class CPU__Monitor extends MonitorSkeleton {
101      }
102  
103   //---ACCESSOR/MUTATOR METHODS---
104 +
105 +    protected Queue getQueue() {
106 +        return MonitorManager.getInstance().getDataQueue();
107 +    }
108  
109   //---ATTRIBUTES---
110  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines