You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Bo Bodnar <bb...@cleversafe.com> on 2015/07/20 21:22:45 UTC

HTTP length content length question

I am transferring, via HTTP PUT, different files.  The test plan I use writes, reads, and deletes these files.  I wish to record a .csv file that has the sizes of the files that are read and written.  A Simple Data Writer achieves this for reads, but it reports the size of the header when doing a write; that is, it doesn't record the size of the payload when doing the write but records the size of the header (in my case, it's always 303 bytes; the file sizes range from 2kB to around 5 MB).

Has anyone done this before?  If so, what approach did you take?

I am using jmeter 2.13.

Best regards,

Bo


Re: HTTP length content length question

Posted by George <ba...@yahoo.de>.
Hi,
well the payload size should be in your request header set as content-length and you can extract this value with a post processor.
Maybe you can do the following.
1) create a post reg. expression to and add it as child to your http put request2) Set "Request Headers" for the "field check" option3) Put a ref. name and set the following req. expression: Content-Length: (\d+)4) Add a "Debug Sampler" and a "View Results Tree" and run your test. In the debug sampler your should be able to see the value of your regerence name. e.g "FileSize_1" should be the pure value (\d+) e.g. 102842
OK.Now you need to "save" this value e.g. in a .txt file. Because next time you run the http put the value will be overwritten by the next http put.
 For this you can do this with a beanshell. You have access to the ReferenceName via ctx in JMeter or vars.get().e.g. String filesize = vars.get("Reference_Name");Maybe you can first just try to print the output on your jmeter console with a simple "System.out.println("FileSize was:" + filesize);
So in general in your http header request you should have access to the content-lenght and this is your file size you want to monitor.
BrGeorge




     Bo Bodnar <bb...@cleversafe.com> schrieb am 21:23 Montag, 20.Juli 2015:
   

 I am transferring, via HTTP PUT, different files.  The test plan I use writes, reads, and deletes these files.  I wish to record a .csv file that has the sizes of the files that are read and written.  A Simple Data Writer achieves this for reads, but it reports the size of the header when doing a write; that is, it doesn't record the size of the payload when doing the write but records the size of the header (in my case, it's always 303 bytes; the file sizes range from 2kB to around 5 MB).

Has anyone done this before?  If so, what approach did you take?

I am using jmeter 2.13.

Best regards,

Bo