Hi Hemadri,

If you mean the source code to calculate these times, it's embarassingly
simple as I am taxed for time and wrote it in like 5 mins, but it's pasted
below.  Just put the source file in the same directory as your results file,
compile it with javac, and use like this:

java ComputeTimes <fileName>

The min, max, and average times will be printed out to the console.  Make
sure that verbose output for your File Reporter is turned OFF in JMeter, as
the code below is expecting one response time per line in the output file.
It also doesn't do any error-handling whatsoever. :)

peace,
Joe






import java.io.*;
import java.util.ArrayList;

public class ComputeTimes{


public static void main( String[] args){

try{
        String fileName = args[0];
        File inputFile = new File(System.getProperty("user.dir"), fileName);
        BufferedReader reader = new BufferedReader( new InputStreamReader(new
FileInputStream(inputFile)) );

        String responseTime = reader.readLine();
        ArrayList timesList = new ArrayList();

        while( responseTime != null){
                timesList.add( new Integer(Integer.parseInt(responseTime)) );
                responseTime = reader.readLine();
        }

        int timesArray[] = new int[timesList.size()];

        for(int i=0; i < timesList.size(); i++){
                timesArray[i] = ((Integer)timesList.get(i)).intValue();
        }


        int sum = 0;
        int min = timesArray[0];
        int max = timesArray[0];

        for(int i=0; i < timesArray.length; i++){
                if( timesArray[i] > max){
                        max = timesArray[i];
                }
                if( timesArray[i] < min){
                        min = timesArray[i];
                }
                sum += timesArray[i];
        }

        float avg = sum / timesArray.length;

        System.out.println("Num responses:  " + timesArray.length);
        System.out.println("Max time:   " + max);
        System.out.println("Min time:   " + min);
        System.out.println("Avg time:   " + avg);
}
catch(Exception e){
e.printStackTrace();
}


}  // end main

} // end class












> -----Original Message-----
> From: Hemadri Dasari [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 30, 2002 6:07 PM
> To: JMeter Users List; [EMAIL PROTECTED]
> Subject: RE: data analyzer weirdness
>
>
> Hi Joe,
>
> Could you please share a sample to calculate
> min/max/avg.
>
> Also, does anyone know why I am getting this error
> when I try to use HTTP Proxy server to record. This
> was with the latest (today's) build:
>
> *****************************
> Initializing...
> Creating Config Object...OK
> Creating Cache Manager...OK
> Creating Daemon Socket... port 8000 OK
> Proxy up and running!
> Command = GET http://hometown.aol.ca/ HTTP/1.0
>
> Command = GET
> http://ht-s15.websys.aol.com:4444/promos.js?i=15934,15856,15583,15
> 544,14800,14881,15817,15505,15232,15076,15895,15622,15661,15778,15115
> HTTP/1.0
>
> Delivering urlconfig to test tree
> Delivering urlconfig to test tree
> Command = GET
> http://ht-s15.websys.aol.com:4444/PromoArt/aol_ca_search_button.gi
> f.11858.1.gif HTTP/1.0
>
> Command = GET
> http://ar.atwola.com/html/93018336/159232004/aol?SNM=HIDBF&CT=I&wi
> dth=234&height=60&target=_top&TZ=240 HTTP/1.0
>
> java.net.SocketException: Connection reset by peer:
> socket write error
>         at
> java.net.SocketOutputStream.socketWrite0(Native
> Method)
>         at
> java.net.SocketOutputStream.socketWrite(Unknown
> Source)
>         at java.net.SocketOutputStream.write(Unknown
> Source)
>         at
> java.io.BufferedOutputStream.flushBuffer(Unknown
> Source)
>         at java.io.BufferedOutputStream.flush(Unknown
> Source)
>         at
> org.apache.jmeter.protocol.http.proxy.Proxy.writeToClient(Proxy.java:
> 328)
>         at
> org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:157)
> Delivering urlconfig to test tree
> Delivering urlconfig to test tree
> ****************
>
> Thanks,
> -Hemadri
> --- Joseph Barefoot <[EMAIL PROTECTED]> wrote:
> > I just wrote a quickie to give me the min/max/avg
> > times from the file data
> > (so I'm good), but I'm still curious about the Data
> > Analyzer--it only
> > appears to be useful for low volume testing.
> >
> > peace,
> > joe
> >
> > > -----Original Message-----
> > > From: Joseph Barefoot
> > [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, April 30, 2002 4:20 PM
> > > To: Jmeter
> > > Subject: data analyzer weirdness
> > >
> > >
> > > Hi,
> > >
> > > I've been having various problems with using the
> > data analyzer on files.
> > > First of all, the graph lines one would expect
> > according to the legend are
> > > never there, it's just one line, I'm assuming
> > representing the average.
> > > Second, sometimes it doesn't work period on
> > results from the file
> > > reporter.
> > > All I really need it for is min/max/avg times, so
> > if someone knows why it
> > > sometimes doesn't compute these, I'm all ears!!
> > :)
> > >
> > >
> > > thanks,
> > > Joe Barefoot
> > >
> > >
> > > P.S.  Thanks to those who set me straight on the
> > multiple login question,
> > > particularly Mark Walsh for his handy User
> > Parameter Modifier.
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > >
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com


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

Reply via email to