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

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/Memory__Monitor.java (file contents):
Revision 1.13 by tdb, Wed Feb 5 16:43:45 2003 UTC vs.
Revision 1.15 by tdb, Mon Mar 10 08:42:57 2003 UTC

# Line 111 | Line 111 | public class Memory__Monitor extends MonitorSkeleton {
111              // we default to false
112          }
113          
114 <        // this  bit determines if the memory check is a % check
115 <        // or a kb check
114 >        // this bit determines if the memory check is a % check
115 >        // or a byte check
116          String type;
117          double curValue;
118          int newThreshold;
119          if(useValue) {
120 <            // kb memory available
120 >            // bytes of memory available
121              if(useCache) {
122                  // NOTE: we take cache as being "probably free" for this check
123                  curValue = memoryFree + memoryCache;
# Line 126 | Line 126 | public class Memory__Monitor extends MonitorSkeleton {
126              }
127              // negate check
128              newThreshold = checkAttributeThreshold(curValue, reg, true);
129 <            type = "kb";
129 >            type = "bytes";
130          } else {
131              // % memory in use
132              if(useCache) {
133                  // NOTE: we take cache as being "probably free" for this check
134 <                curValue = (1 - ((memoryFree + memoryCache) / memoryTotal)) * 100;
134 >                curValue = (1 - (((double)memoryFree + (double)memoryCache) / (double)memoryTotal)) * 100;
135              } else {
136 <                curValue = (1 - (memoryFree / memoryTotal)) * 100;
136 >                curValue = (1 - ((double)memoryFree / (double)memoryTotal)) * 100;
137              }
138              // normal check
139              newThreshold = checkAttributeThreshold(curValue, reg, false);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines