Bug report for JMeter [2011/04/03]
+---+ | Bugzilla Bug ID | | +-+ | | Status: UNC=Unconfirmed NEW=New ASS=Assigned| | | OPN=ReopenedVER=Verified(Skipped Closed/Resolved) | | | +-+ | | | Severity: BLK=Blocker CRI=Critical REG=Regression MAJ=Major | | | | MIN=Minor NOR=NormalENH=Enhancement TRV=Trivial | | | | +-+ | | | | Date Posted | | | | | +--+ | | | | | Description | | | | | | | |11536|Ass|Enh|2002-08-07|Graph Results's throughput calculation includes id| |15468|New|Enh|2002-12-18|Variable expansion in posted files in HTTPSampler | |15999|New|Enh|2003-01-12|Show Results Tree is too HTTP-centric | |16370|New|Enh|2003-01-23|HTTP Request log | |16886|New|Enh|2003-02-07|Recorded requests shouldn't duplicate info in HTTP| |17248|New|Enh|2003-02-20|Graph Improvements| |17252|Ass|Enh|2003-02-20|HTML Link Parser seems not work properly. | |21695|New|Enh|2003-07-17|Unix jmeter start script assumes it is on PATH, no| |22076|New|Enh|2003-08-01|global search and replace functionality | |22510|New|Maj|2003-08-18|SSL Manager does not handle multiple client certif| |24480|New|Enh|2003-11-06|There is no good way to set checkbox based items u| |25209|New|Min|2003-12-04|missed refresh of horizontal scrollbar when switch| |25430|New|Enh|2003-12-11|Recording Controller to populate HTTP Authorisatio| |27112|New|Enh|2004-02-20|User Parameters should use scrollbars | |27895|New|Enh|2004-03-24|badly formatted JDBC output (a regression w.r.t. 1| |29331|New|Enh|2004-06-01|how to load test java applet using JMeter | |29352|New|Enh|2004-06-03|Use external store to hold samples during distribu| |29603|New|Enh|2004-06-16|Custom component developers need own resource bund| |29708|New|Enh|2004-06-21|startup delay by JMeterThread initialization | |31666|New|Enh|2004-10-12|writing sampleresults to databases| |32494|New|Enh|2004-12-02|Enhancement - scheduler should be added to Test Pl| |33305|New|Enh|2005-01-31|Visual diff and merge functionality for JMeter scr| |33878|New|Enh|2005-03-07|Function caching as option| |33940|Opn|Nor|2005-03-09|Throughput value and Graph Results Graphing don'| |34321|New|Enh|2005-04-06|password encryption for HTTP Authorization Manager| |35059|New|Maj|2005-05-25|RuntimeController not working correctly | |35593|New|Enh|2005-07-03|Commons chain sampler | |35670|New|Enh|2005-07-09|Default parameters not displayed | |35915|New|Enh|2005-07-28|MonitorResults does not write results n CSV format| |36378|New|Enh|2005-08-26|[PATCH] A Thread Watcher Listener | |36694|New|Enh|2005-09-17|substitute a value in the input XML for webservice| |36721|New|Enh|2005-09-20|webMethods Sampling Protocol Extensions | |36931|New|Enh|2005-10-05|Printable Version of the Users Manual | |37073|New|Enh|2005-10-13|Lacking Poisson timer | |37155|New|Enh|2005-10-19|Testplan: Stop... Continue| |37160|New|Enh|2005-10-19|Scalable distributed testing | |38115|Inf|Nor|2006-01-04|decode from encoded string by IE | |39219|New|Nor|2006-04-06|HTTP Server: You can't stop it after File-Open | |39642|New|Enh|2006-05-23|Need a sampler forJMX mbean-servers. | |40011|New|Enh|2006-07-11|New Elements for use in JMeter| |40181|Ass|Enh|2006-08-03|Add a new Session Bean protocol extension | |40424|New|Enh|2006-09-06|Web Services proxy| |40499|New|Enh|2006-09-13|Need to be able to simulate abortive connection re| |40671|New|Cri|2006-10-03|IncludeController not working in Jmeter 2.2 | |40750|New|Nor|2006-10-12|Behaviour when TCPSampler sockets are closed by re| |40934|Inf|Nor|2006-11-09|CSV Data Set Config parameters cannot be used in s| |40961|New|Enh|2006-11-13|Maintain constant number of clients after assertio| |40973|New|Nor|2006-11-14|[View Results Tree] component failed when generate| |41110|New|Enh|2006-12-05|Jmeter does not record calculated values, such as | |41210|Inf|Enh|2006-12-19|Latency time is not included in the summary report| |41286|New|Nor|2007-01-03|Include controller problems in Jmeter 2.1.1. |
Re: [JMeter] JUnit sampler sample time changes
That reminds me - Tests I've done on Windows show that nanoTime() drifts considerably when compared with currentTimeMillis(), i.e. its clock does not appear to run at the same rate. Here's a simple test you can run: public class NanoDrift { public static void main(String[] args) throws InterruptedException { long systemTime = System.currentTimeMillis(); long nanoTime = System.nanoTime() / 100; long count=0; while(true){ long systemDiff = System.currentTimeMillis() - systemTime; long nanoDiff = System.nanoTime() / 100 - nanoTime; long absdiff = Math.abs(systemDiff-nanoDiff); if (absdiff 100 || (count % 60 == 0)) { System.out.println(@:+count+ |S-N|:+absdiff+ S:+systemDiff + N: + nanoDiff); } Thread.sleep(1000); count++; } } } Behaviour may depend on the JVM used; on java version 1.6.0_24 Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing) I just got @:0 |S-N|:0 S:0 N:0 @:60 |S-N|:0 S:60032 N:60032 @:120 |S-N|:1 S:120032 N:120033 @:180 |S-N|:2 S:180032 N:180034 @:240 |S-N|:6 S:240032 N:240038 @:300 |S-N|:7 S:300032 N:300039 @:360 |S-N|:13 S:360032 N:360045 @:420 |S-N|:14 S:420032 N:420046 @:480 |S-N|:15 S:480032 N:480047 @:540 |S-N|:16 S:540032 N:540048 @:600 |S-N|:17 S:600032 N:600049 @:660 |S-N|:18 S:660032 N:660050 @:720 |S-N|:19 S:720032 N:720051 @:780 |S-N|:20 S:780032 N:780052 @:840 |S-N|:21 S:840032 N:840053 @:900 |S-N|:22 S:900032 N:900054 @:960 |S-N|:23 S:960032 N:960055 @:1020 |S-N|:24 S:1020032 N:1020056 @:1080 |S-N|:21 S:1080063 N:1080084 @:1140 |S-N|:22 S:1140063 N:1140085 @:1200 |S-N|:23 S:1200063 N:1200086 @:1260 |S-N|:24 S:1260063 N:1260087 @:1320 |S-N|:21 S:1320172 N:1320193 @:1380 |S-N|:36 S:1380172 N:1380208 @:1440 |S-N|:37 S:1440172 N:1440209 @:1500 |S-N|:38 S:1500172 N:1500210 @:1560 |S-N|:40 S:1560172 N:1560212 @:1620 |S-N|:41 S:1620172 N:1620213 @:1680 |S-N|:42 S:1680172 N:1680214 @:1740 |S-N|:29 S:1740188 N:1740217 @:1800 |S-N|:30 S:1800188 N:1800218 @:1860 |S-N|:31 S:1860188 N:1860219 @:1920 |S-N|:31 S:1920188 N:1920219 @:1980 |S-N|:32 S:1980188 N:1980220 @:2040 |S-N|:33 S:2040188 N:2040221 @:2100 |S-N|:34 S:2100188 N:2100222 @:2160 |S-N|:35 S:2160188 N:2160223 @:2220 |S-N|:36 S:2220188 N:2220224 @:2280 |S-N|:37 S:2280188 N:2280225 @:2340 |S-N|:38 S:2340188 N:2340226 @:2400 |S-N|:39 S:2400188 N:2400227 @:2460 |S-N|:40 S:2460188 N:2460228 @:2520 |S-N|:41 S:2520188 N:2520229 However, on a FreeBSD system using java version 1.6.0_03-p4 Java(TM) SE Runtime Environment (build 1.6.0_03-p4-root_17_dec_2010_05_08-b00) Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_03-p4-root_17_dec_2010_05_08-b00, mixed mode) I see no drift: @:0 |S-N|:0 S:0 N:0 @:60 |S-N|:0 S:60118 N:60118 @:120 |S-N|:0 S:120239 N:120239 @:180 |S-N|:1 S:180357 N:180358 @:240 |S-N|:0 S:240476 N:240476 @:300 |S-N|:0 S:300594 N:300594 @:360 |S-N|:0 S:360713 N:360713 @:420 |S-N|:0 S:420830 N:420830 @:480 |S-N|:1 S:480948 N:480949 @:540 |S-N|:0 S:541066 N:541066 @:600 |S-N|:0 S:601184 N:601184 @:660 |S-N|:0 S:661302 N:661302 @:720 |S-N|:0 S:721419 N:721419 @:780 |S-N|:0 S:781537 N:781537 @:840 |S-N|:0 S:841655 N:841655 @:900 |S-N|:0 S:901773 N:901773 @:960 |S-N|:1 S:961890 N:961891 @:1020 |S-N|:0 S:1022008 N:1022008 @:1080 |S-N|:0 S:1082126 N:1082126 @:1140 |S-N|:0 S:1142244 N:1142244 @:1200 |S-N|:1 S:1202361 N:1202362 @:1260 |S-N|:1 S:1262479 N:1262480 @:1320 |S-N|:0 S:1322600 N:1322600 @:1380 |S-N|:1 S:1382748 N:1382749 @:1440 |S-N|:0 S:1442879 N:1442879 @:1500 |S-N|:1 S:1502997 N:1502998 @:1560 |S-N|:0 S:1563115 N:1563115 @:1620 |S-N|:0 S:1623233 N:1623233 @:1680 |S-N|:0 S:1683351 N:1683351 @:1740 |S-N|:0 S:1743468 N:1743468 @:1800 |S-N|:0 S:1803586 N:1803586 @:1860 |S-N|:0 S:1863704 N:1863704 @:1920 |S-N|:1 S:1923838 N:1923839 @:1980 |S-N|:0 S:1983959 N:1983959 @:2040 |S-N|:1 S:2044077 N:2044078 @:2100 |S-N|:0 S:2104195 N:2104195 @:2160 |S-N|:0 S:2164313 N:2164313 @:2220 |S-N|:1 S:2224430 N:2224431 @:2280 |S-N|:1 S:2284548 N:2284549 @:2340 |S-N|:0 S:2344666 N:2344666 @:2400 |S-N|:1 S:2404784 N:2404785 @:2460 |S-N|:0 S:2464903 N:2464903 @:2520 |S-N|:0 S:2525020 N:2525020 @:2580 |S-N|:0 S:2585138 N:2585138 @:2640 |S-N|:0 S:2645256 N:2645256 On 3 April 2011 13:50, Peter Lin wool...@gmail.com wrote: Another important thing to consider is that nano time costs a lot more than System.currentTimeMillis(). I've done some benchmarking in the past and nano time costs 30% on windows. On linux, the cost is higher due to differences in how it's implemented. On Sun, Apr 3, 2011 at 5:28 AM, sebb seb...@gmail.com wrote: On 3 April 2011 08:32, Ben Cuthbert ben_cuthb...@yahoo.co.uk wrote: I see the nanotime. But the time in the sampler results is reported in ms. So when you have you data it just says 0. I would like it to go one further and report a low level. Sorry, that's not possible currently.
Re: [JMeter] JUnit sampler sample time changes
I've talked with BEA's JRockit team in the past regarding the differences in Nano time on different platforms. Given these issues, using nano time in JMeter is difficult at best. From what I am told by Henrik stahl, making nano time reliable and performant isn't trivial, so using it to measure performance isn't really recommended. As far as I know, the only way to get reliable high performance nano time is if the OS provides it. On Sun, Apr 3, 2011 at 9:45 AM, sebb seb...@gmail.com wrote: That reminds me - Tests I've done on Windows show that nanoTime() drifts considerably when compared with currentTimeMillis(), i.e. its clock does not appear to run at the same rate. Here's a simple test you can run: public class NanoDrift { public static void main(String[] args) throws InterruptedException { long systemTime = System.currentTimeMillis(); long nanoTime = System.nanoTime() / 100; long count=0; while(true){ long systemDiff = System.currentTimeMillis() - systemTime; long nanoDiff = System.nanoTime() / 100 - nanoTime; long absdiff = Math.abs(systemDiff-nanoDiff); if (absdiff 100 || (count % 60 == 0)) { System.out.println(@:+count+ |S-N|:+absdiff+ S:+systemDiff + N: + nanoDiff); } Thread.sleep(1000); count++; } } } Behaviour may depend on the JVM used; on java version 1.6.0_24 Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing) I just got @:0 |S-N|:0 S:0 N:0 @:60 |S-N|:0 S:60032 N:60032 @:120 |S-N|:1 S:120032 N:120033 @:180 |S-N|:2 S:180032 N:180034 @:240 |S-N|:6 S:240032 N:240038 @:300 |S-N|:7 S:300032 N:300039 @:360 |S-N|:13 S:360032 N:360045 @:420 |S-N|:14 S:420032 N:420046 @:480 |S-N|:15 S:480032 N:480047 @:540 |S-N|:16 S:540032 N:540048 @:600 |S-N|:17 S:600032 N:600049 @:660 |S-N|:18 S:660032 N:660050 @:720 |S-N|:19 S:720032 N:720051 @:780 |S-N|:20 S:780032 N:780052 @:840 |S-N|:21 S:840032 N:840053 @:900 |S-N|:22 S:900032 N:900054 @:960 |S-N|:23 S:960032 N:960055 @:1020 |S-N|:24 S:1020032 N:1020056 @:1080 |S-N|:21 S:1080063 N:1080084 @:1140 |S-N|:22 S:1140063 N:1140085 @:1200 |S-N|:23 S:1200063 N:1200086 @:1260 |S-N|:24 S:1260063 N:1260087 @:1320 |S-N|:21 S:1320172 N:1320193 @:1380 |S-N|:36 S:1380172 N:1380208 @:1440 |S-N|:37 S:1440172 N:1440209 @:1500 |S-N|:38 S:1500172 N:1500210 @:1560 |S-N|:40 S:1560172 N:1560212 @:1620 |S-N|:41 S:1620172 N:1620213 @:1680 |S-N|:42 S:1680172 N:1680214 @:1740 |S-N|:29 S:1740188 N:1740217 @:1800 |S-N|:30 S:1800188 N:1800218 @:1860 |S-N|:31 S:1860188 N:1860219 @:1920 |S-N|:31 S:1920188 N:1920219 @:1980 |S-N|:32 S:1980188 N:1980220 @:2040 |S-N|:33 S:2040188 N:2040221 @:2100 |S-N|:34 S:2100188 N:2100222 @:2160 |S-N|:35 S:2160188 N:2160223 @:2220 |S-N|:36 S:2220188 N:2220224 @:2280 |S-N|:37 S:2280188 N:2280225 @:2340 |S-N|:38 S:2340188 N:2340226 @:2400 |S-N|:39 S:2400188 N:2400227 @:2460 |S-N|:40 S:2460188 N:2460228 @:2520 |S-N|:41 S:2520188 N:2520229 However, on a FreeBSD system using java version 1.6.0_03-p4 Java(TM) SE Runtime Environment (build 1.6.0_03-p4-root_17_dec_2010_05_08-b00) Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_03-p4-root_17_dec_2010_05_08-b00, mixed mode) I see no drift: @:0 |S-N|:0 S:0 N:0 @:60 |S-N|:0 S:60118 N:60118 @:120 |S-N|:0 S:120239 N:120239 @:180 |S-N|:1 S:180357 N:180358 @:240 |S-N|:0 S:240476 N:240476 @:300 |S-N|:0 S:300594 N:300594 @:360 |S-N|:0 S:360713 N:360713 @:420 |S-N|:0 S:420830 N:420830 @:480 |S-N|:1 S:480948 N:480949 @:540 |S-N|:0 S:541066 N:541066 @:600 |S-N|:0 S:601184 N:601184 @:660 |S-N|:0 S:661302 N:661302 @:720 |S-N|:0 S:721419 N:721419 @:780 |S-N|:0 S:781537 N:781537 @:840 |S-N|:0 S:841655 N:841655 @:900 |S-N|:0 S:901773 N:901773 @:960 |S-N|:1 S:961890 N:961891 @:1020 |S-N|:0 S:1022008 N:1022008 @:1080 |S-N|:0 S:1082126 N:1082126 @:1140 |S-N|:0 S:1142244 N:1142244 @:1200 |S-N|:1 S:1202361 N:1202362 @:1260 |S-N|:1 S:1262479 N:1262480 @:1320 |S-N|:0 S:1322600 N:1322600 @:1380 |S-N|:1 S:1382748 N:1382749 @:1440 |S-N|:0 S:1442879 N:1442879 @:1500 |S-N|:1 S:1502997 N:1502998 @:1560 |S-N|:0 S:1563115 N:1563115 @:1620 |S-N|:0 S:1623233 N:1623233 @:1680 |S-N|:0 S:1683351 N:1683351 @:1740 |S-N|:0 S:1743468 N:1743468 @:1800 |S-N|:0 S:1803586 N:1803586 @:1860 |S-N|:0 S:1863704 N:1863704 @:1920 |S-N|:1 S:1923838 N:1923839 @:1980 |S-N|:0 S:1983959 N:1983959 @:2040 |S-N|:1 S:2044077 N:2044078 @:2100 |S-N|:0 S:2104195 N:2104195 @:2160 |S-N|:0 S:2164313 N:2164313 @:2220 |S-N|:1 S:2224430 N:2224431 @:2280 |S-N|:1 S:2284548 N:2284549 @:2340 |S-N|:0 S:2344666 N:2344666 @:2400 |S-N|:1 S:2404784 N:2404785 @:2460 |S-N|:0 S:2464903 N:2464903 @:2520 |S-N|:0 S:2525020 N:2525020 @:2580 |S-N|:0 S:2585138 N:2585138 @:2640 |S-N|:0 S:2645256 N:2645256 On 3 April 2011 13:50, Peter Lin wool...@gmail.com wrote:
Re: svn commit: r1088435 - in /jakarta/jmeter/trunk: bin/ src/core/org/apache/jmeter/util/ src/protocol/http/org/apache/jmeter/protocol/http/sampler/ xdocs/ xdocs/usermanual/
On 4 April 2011 00:13, milam...@apache.org wrote: Author: milamber Date: Sun Apr 3 23:13:09 2011 New Revision: 1088435 URL: http://svn.apache.org/viewvc?rev=1088435view=rev Log: Bug 50170 - Bytes reported by http sampler is after GUnZip Add an optional property to allow change the method to get response size. Modified: jakarta/jmeter/trunk/bin/jmeter.properties jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java jakarta/jmeter/trunk/xdocs/changes.xml jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml Modified: jakarta/jmeter/trunk/bin/jmeter.properties URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/bin/jmeter.properties?rev=1088435r1=1088434r2=1088435view=diff == --- jakarta/jmeter/trunk/bin/jmeter.properties (original) +++ jakarta/jmeter/trunk/bin/jmeter.properties Sun Apr 3 23:13:09 2011 @@ -243,6 +243,16 @@ log_level.jorphan=INFO #log_config=logkit.xml #--- +# HTTP common configuration +#--- + +# Response size calculate method +# default: only data (uncompress size if deflate) +#http.getbytes.type=default +#http.getbytes.type=calculate_headers_size+default +#http.getbytes.type=calculate_headers_size+content-length_value These values are a bit complicated; I'd prefer to see true/false values if possible. + +#--- # HTTP Java configuration #--- Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java?rev=1088435r1=1088434r2=1088435view=diff == --- jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java (original) +++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java Sun Apr 3 23:13:09 2011 @@ -36,10 +36,12 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; +import java.util.Map.Entry; import java.util.MissingResourceException; import java.util.Properties; import java.util.Random; import java.util.ResourceBundle; +import java.util.Set; import java.util.StringTokenizer; import java.util.Vector; @@ -73,6 +75,8 @@ public class JMeterUtils implements Unit new Perl5Compiler()); private static final String EXPERT_MODE_PROPERTY = jmeter.expertMode; // $NON-NLS-1$ + + private static final String HEADER_CONTENT_LENGTH = Content-Length; // $NON-NLS-1$ private static final String ENGLISH_LANGUAGE = Locale.ENGLISH.getLanguage(); @@ -1237,4 +1241,19 @@ public class JMeterUtils implements Unit return linkedHeaders; } + /** + * Get Content-Length value from headers + * @param headers + * @return Content-Length value + */ + public static int getHeaderContentLength(String headers) { + LinkedHashMapString, String lhm = JMeterUtils.parseHeaders(headers); + SetEntryString, String keySet = lhm.entrySet(); + for (EntryString, String entry : keySet) { + if (entry.getKey().equals(HEADER_CONTENT_LENGTH)) { + return Integer.parseInt(entry.getValue()); + } + } + return 0; // Content-Length not found This does not work for chunked input. It might be better to store the actual response size when receiving the response, rather than trying to calculate it later. + } } Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java?rev=1088435r1=1088434r2=1088435view=diff == --- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java (original) +++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.java Sun Apr 3 23:13:09 2011 @@ -23,6 +23,7 @@ import java.net.URL; import org.apache.jmeter.protocol.http.util.HTTPConstants; import org.apache.jmeter.samplers.SampleResult; +import org.apache.jmeter.util.JMeterUtils; /** * This is a specialisation of the SampleResult class for the HTTP protocol. @@ -31,6 +32,15 @@ import org.apache.jmeter.samplers.Sample public class HTTPSampleResult extends SampleResult {