You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by "neth6 atozasia.com" <ne...@atozasia.com> on 2001/07/21 17:35:11 UTC

Re: dynamicity, uploading, cache, images (awfully long!!!)

Before I begin, pls feel free to email me or the list if you have any problems.  Will try my best to assist.

Ok, I'm gonna post the extension to HTTPSampler and UrlConfig here.  They are intended to download and sample a web page with all images & applets.  The tags which I look for are <img...>, <input type="image"...> and <applet...>.  They are called HTTPSamplerFull and UrlConfigFull.  Sorry but I can't think of what else to call them.

To speed up my development, I used jTidy as a HTML parser.  I wasn't aware of jMeter's own html parser and moreover jMeter's html parser was in early stages of development when I started on this.  I will change it to use jMeter's html parser when it's ready.

If you feel it's worthwhile to proceed, pls download jTidy from "http://lempinen.net/sami/jtidy/".

The steps below will help you to get a ConfigElement called "UrlSample Full" on your jmeter gui.  Configure 'UrlSample Full' as you would for 'Url Sample'.

If the steps below are not displayed in proper format by your mail client/browser, I've attached a document "changes.txt" below which u can detach to read instead.

The required files are also attached below

--- Start ---

IMPORTANT : All things within square brackets "<...>" are suppose to be substituted with appropriate values in your environment
IMPORTANT : You need jTidy - an open source Html Parser for this to work. I used jTidy to speed up my work but the ultimately jmeter might have its own parser.  Please download jTidy from  sourceforge
WARNING : For some reason or another ClassFinder.class can't seem to
understand that for user (e.g. goro) the directory /home/goro/jmeter/
is the same as ~/jmeter/.  Please set CLASSPATH using the full extension and not using ~ for the time being.
Another grouse about ClassFinder.class is that it seems to think that /home/goro/jmeter/ and /home/goro/jmeter (without the ending slash)
is different.  I've modified to ClassFinder.java to rectify this error but I'm not sure if the one u have is up to date.  To be safe,
use directories without the ending slash.  BE VERY CAREFUL though when using auto-completeion with bash shell (hitting 'tab' key) 'cos that          automatically appends a ending slash

0. edit 
   <jakarta-jmeter>/src/org/apache/jmeter/protocol/http/sampler/HTTPSampler.java
   a. change 'private String readResponse(HttpUrlConnection conn) ...'
      to 'protected ...'
      i.e. change readResponse method from private to protected 'cos
      the extension HTTPSamplerFull.java also need to use this method
0.5 copy the new HttpTestSample.java to
   <jakarta-jmeter>/src/org/apache/jmeter/protocol/http/control/
1. build jmeter using ant
2. chmod a+x <jakarta-jmeter>/bin/jmeter
3. edit <jakarta-jmeter>/bin/jmeter.properties
   a. change the search_paths to
      search_paths=.;<jakarta-jmeter>/bin/classes;<jakarta-jmeter>/ext
IMPORTANT : The rational behind using <jakarta-jmeter>/bin/classes instead
            of ApacheJMeter.jar is to enable me to make changes to classes
            and then just copy them to the appropriate directories in
            <jakarta-jmeter>/bin/classes without having to recompile and
            then jar them everytime into ApacheJMeter.
IMPORTANT : Don't put ending slash for directories (see WARNING above).
4. set your classpath to include (see WARNING above). Also note that the 
   original CLASSPATH is set at the end (just in case)
   <jakarta-jmeter>/bin/classes:<jakarta-jmeter>/ext:$CLASSPATH
   AND
   <jtidy>/Tidy.jar
5. also make the following directory trees
   <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/sampler/
   <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/config/
NOTE : It was suggested I write the HTTP Sampler which automatically download
       images and applets as an extension which can be dumped in 
       <jakarta-jmeter>/ext/.  Thus, forgive the eponymous package name.  This 
       effort will also help determine how to incorporate future extensions 
       easily by just writing sampler, config element classes without having to
       tinker with the rest of jmeter codes like what I had to go through. Also
       if the codes gets incorporated into jmeter then I'll change the package
       name.
6. copy UrlConfigFull.java to 
   <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/config/
7. copy HTTPSamplerFull.java to
   <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/sampler/
8. compile both of them using
   javac <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/config/UrlConfigFull.java
   javac <jakarta-jmeter>/ext/com/hin/jmeter/protocol/http/config/HTTPSamplerFull.java

--- End ---

-----Original Message-----
From: Mike Stover <ms...@apache.org>
Date: Thu, 19 Jul 2001 08:25:00 +0000
To: "Raphael PIERONI" <ra...@wanadoo.fr>,
jmeter-dev@jakarta.apache.org
Subject: Re: dynamicity, uploading, cache, images


> 
> > but as i need the total weigth of the page including images, i cannot let
> > another object than the sampler do the task of downloading images, or at
> > least have the weigth in return
> 
> Oh, good point.  There is someone out there who has finished creating an 
> HTTPSampler version that parses the results and grabs all images in the page. 
>  Maybe, if you could get a copy of that, you could add your caching in to 
> that sampler (or sub-class it).  
> 
> >
> > thanks Raphael
> >
> > > -Mike
> 
> -- 
> Mike Stover
> mstover1@apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
> 
> 

-- 

__________________________________________________
Get FREE 50 MB email @ http://www.AtoZasia.com



Powered by Outblaze