apache / apache/jmeter

JMeter Produces Negative Results

Open
#5,665 0 comments 0 reactions 0 assignees View on GitHub
P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**emadrid** ([Bug 66051](https://bz.apache.org/bugzilla//show_bug.cgi?id=66051&redirect=false)):
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.

Severity: normal
OS:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.