Bug 66051

Summary: JMeter Produces Negative Results
Product: JMeter - Now in Github Reporter: emadrid
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 5.3   
Target Milestone: JMETER_5.5   
Hardware: PC   
OS:    

Description emadrid 2022-05-04 16:48:56 UTC
I came across this issue in JMeter where it would provide negative results when calling the getTime() method in SampleResult.java. I suspect this may be an issue with how elapsedTime is calculated in setEndTime() with the calculated parameters that are fed into this method from addSubResult(), as this method does some calculations with nanoTimeOffsets, which my JMeter configuration is currently set to utilize.

https://github.com/apache/jmeter/blob/aaead67610cd61d486d6ae54dab7b05338bcf40a/src/core/src/main/java/org/apache/jmeter/samplers/SampleResult.java#L655

I thought another thing that may be related to the issue is truncation in the long data-type divison in sampleNsClockInMs(), but it seems this would only cause a small offset from the actual result but I have had Jmeter produce results up to -229 ms.

When the results come back negative, the values are also identical across AverageResponseTime, MinResponseTime, MaxResponseTime, Percentile50, Percentile90, and Percentile95.

As far as the configuration for the settings that affect the SampleResults, the only one I have configured is:  sampleresult.timestamp.start=true

The defaults are being used for the rest of the sampleresult settings.
Comment 1 The ASF infrastructure team 2022-09-24 20:38:23 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5665