Monitoring HTTP performance using Jigsaw

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 UTC