mstover1    2004/05/13 06:58:53

  Modified:    .        build.xml
               src/core/org/apache/jmeter/util JMeterVersion.java
               src/jorphan/org/apache/jorphan/math StatCalculator.java
               test/src/org/apache/jorphan/math TestStatCalculator.java
  Log:
  New Percent Point calculation in StatCalculator - ie, to get the 90% line, or any 
other percent line
  
  Revision  Changes    Path
  1.178     +8 -6      jakarta-jmeter/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-jmeter/build.xml,v
  retrieving revision 1.177
  retrieving revision 1.178
  diff -u -r1.177 -r1.178
  --- build.xml 16 Apr 2004 13:21:44 -0000      1.177
  +++ build.xml 13 May 2004 13:58:53 -0000      1.178
  @@ -221,7 +221,7 @@
     </path>
   
     <!-- Temporary build directories: where the .class live -->
  -  <property name="build.dir" value="build"/>
  +  <property name="build.dir" location="build"/>
     <property name="build.core" value="build/core"/>
     <property name="build.http" value="build/protocol/http"/>
     <property name="build.ftp" value="build/protocol/ftp"/>
  @@ -1203,14 +1203,16 @@
      test.headless = ${test.headless}
      user.dir = ${user.dir}
      basedir = ${basedir}
  +   test dir = ${build.dir}/test
      </echo>
      <java classname="org.apache.jorphan.test.AllTests" fork="yes" 
dir="${basedir}/bin">
         <classpath>
        <path refid="classpath"/>
        <fileset dir="${dest.jar}" includes="*.jar"/>
  +     <pathelement location="${build.dir}/test"/>
         </classpath>
         <sysproperty key="java.awt.headless" value="${test.headless}"/>
  -      <arg value="../lib/ext"/>
  +      <arg value="${build.dir}/test,../lib/ext"/>
         <arg value="./jmetertest.properties"/>
         <arg value="org.apache.jmeter.util.JMeterUtils"/>
       </java>
  
  
  
  1.16      +3 -3      
jakarta-jmeter/src/core/org/apache/jmeter/util/JMeterVersion.java
  
  Index: JMeterVersion.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/util/JMeterVersion.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- JMeterVersion.java        16 Apr 2004 13:21:44 -0000      1.15
  +++ JMeterVersion.java        13 May 2004 13:58:53 -0000      1.16
  @@ -41,7 +41,7 @@
         * pattern: VERSION = <quote>.*<quote>
         * 
         */
  -     static final String VERSION = "2.0.20040416";
  +     static final String VERSION = "2.0.20040513";
   
       private JMeterVersion() // Not instantiable
       {
  
  
  
  1.3       +27 -3     
jakarta-jmeter/src/jorphan/org/apache/jorphan/math/StatCalculator.java
  
  Index: StatCalculator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/jorphan/org/apache/jorphan/math/StatCalculator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StatCalculator.java       11 Feb 2004 23:57:23 -0000      1.2
  +++ StatCalculator.java       13 May 2004 13:58:53 -0000      1.3
  @@ -74,7 +74,31 @@
   
       public Number getMedian()
       {
  -        return (Number) values.get(values.size() / 2);
  +        return (Number) values.get((int)(values.size() * .5));
  +    }
  +    
  +    /**
  +     * Get the value which %percent% of the values are less than.  This works just 
like 
  +     * median (where median represents the 50% point).  A typical desire is to see 
the 90%
  +     * point - the value that 90% of the data points are below, the remaining 10% 
are above.
  +     * @param percent
  +     * @return
  +     */
  +    public Number getPercentPoint(float percent)
  +    {
  +        return (Number) values.get((int)(values.size() * percent));
  +    }
  +    
  +    /**
  +     * Get the value which %percent% of the values are less than.  This works just 
like 
  +     * median (where median represents the 50% point).  A typical desire is to see 
the 90%
  +     * point - the value that 90% of the data points are below, the remaining 10% 
are above.
  +     * @param percent
  +     * @return
  +     */
  +    public Number getPercentPoint(double percent)
  +    {
  +        return (Number) values.get((int)(values.size() * percent));
       }
       
       public double getMean()
  @@ -114,7 +138,7 @@
               values.add(val);
           }
           else
  -        {;
  +        {
               values.add((index * (-1)) - 1, val);
           }
           count++;
  
  
  
  1.2       +0 -1      
jakarta-jmeter/test/src/org/apache/jorphan/math/TestStatCalculator.java
  
  Index: TestStatCalculator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/test/src/org/apache/jorphan/math/TestStatCalculator.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestStatCalculator.java   13 May 2004 13:43:25 -0000      1.1
  +++ TestStatCalculator.java   13 May 2004 13:58:53 -0000      1.2
  @@ -38,7 +38,6 @@
       
       public void testPercentagePoint() throws Exception
       {
  -        System.out.println("calc test going on");
           calc.addValue(10);
           calc.addValue(9);
           calc.addValue(5);
  
  
  

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

Reply via email to