W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 2000

Monitoring HTTP performance using Jigsaw

From: Eamon.Dalton <eamon.dalton@cs.tcd.ie>
Date: Fri, 15 Sep 2000 07:50:47 -0400 (EDT)
Message-ID: <39C20B69.14F7FE36@cs.tcd.ie>
To: www-jigsaw@w3.org
Hi,

I'm currently running Jigsaw in proxy configuration with a filter that I
have developed. The filter is a client side filter that implements
PropRequestFilter.

org.w3c.www.protocol.http.filters=org.w3c.www.protocol.http.myClientSideFilter

I need to measure the amount of data and the rate that the data is
transferred between a user making HTTP request and a target server via
Jigsaw in proxy configuration.


In ingoingFilter the following happens.

 if(request.hasOutputStream()){
   try {
     PipedOutputStream pout = new PipedOutputStream();
     PipedInputStream  pin  = new PipedInputStream(pout);
     new RequestDataMover(request.getOutputStream(),pout);
     request.setOutputStream(pin);
    } catch (Exception ex) {
    }
 }


What I want to know is based on the code below

1. Is this an accurate way to measure throughput between the end-user
making a HTTP requests and a target HTTP server via Jigsaw in proxy
configuration?

2. Will monitoring like this have a significant impact on throughput
performance?

3. If  it will impact performance, how could this be overcome?

Thanks,
            Eamon.




class RequestDataMover extends Thread {

 InputStream in = null;
 OutputStream out = null;

 RequestDataMover(InputStream in, OutputStream out) {
    this.in  = in;
    this.out = out;
    setName("RequestDataMover");
    start();
 }


public void run() {
   try {

   byte buf[] = new byte[1];
   int  got   = -1;
   int contentLenght = 0;

   //Print Time of transfer starting
   while ((got = in.read(buf)) >= 0){
      out.write(buf, 0, got);
      contentLenght = contentLenght + 1;
   }
   //Print Time of transfer ending
   //Print contentLenght

  } catch (IOException ex) {
     ex.printStackTrace();
   } finally {
     try { in.close(); } catch (Exception ex) {};
     try { out.close(); } catch (Exception ex) {} ;
   }
 }
}
Received on Friday, 15 September 2000 08:06:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:34 GMT