woolfel     2005/02/11 05:56:11

  Modified:    src/monitor/components/org/apache/jmeter/monitor/util
                        Stats.java
  Log:
  changed the load calculation to use used/total instead of free/total

  

  peter
  
  Revision  Changes    Path
  1.10      +7 -4      
jakarta-jmeter/src/monitor/components/org/apache/jmeter/monitor/util/Stats.java
  
  Index: Stats.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/monitor/components/org/apache/jmeter/monitor/util/Stats.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Stats.java        22 Dec 2004 17:32:00 -0000      1.9
  +++ Stats.java        11 Feb 2005 13:56:11 -0000      1.10
  @@ -123,9 +123,11 @@
   
        /**
         * Method will calculate the memory load:
  -      * free / max = load. The load value is an
  +      * used / max = load. The load value is an
         * integer between 1 and 100. It is the
  -      * percent memory free.
  +      * percent memory used.
  +      * Changed this to be more like other system monitors.
  +      * Peter Lin 2-11-05
         * @param stat
         * @return memory load
         */     
  @@ -134,7 +136,8 @@
                if (stat != null){
                        double total = 
(double)stat.getJvm().getMemory().getTotal();
                        double free = 
(double)stat.getJvm().getMemory().getFree();
  -                     load = (free/total);
  +                     double used = total - free;
  +                     load = (used/total);
                }
                return (int)(load * 100);
        }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to