vlsi commented on code in PR #5920:
URL: https://github.com/apache/jmeter/pull/5920#discussion_r1196481242


##########
src/core/src/main/java/org/apache/jmeter/util/Calculator.java:
##########
@@ -115,58 +110,74 @@ public void addSample(SampleResult res) {
         addBytes(res.getBytesAsLong());
         addSentBytes(res.getSentBytes());
         addValue(res.getTime(),res.getSampleCount());
-        errors+=res.getErrorCount(); // account for multiple samples
-        if (startTime == 0){ // not yet initialised
-            startTime=res.getStartTime();
-        } else {
-            startTime = Math.min(startTime, res.getStartTime());
-        }
-        elapsedTime = Math.max(elapsedTime, res.getEndTime()-startTime);
+        errors.add(res.getErrorCount()); // account for multiple samples
+        LongAccumulator startTime = this.startTime;
+        startTime.accumulate(res.getStartTime());
+        long testStarted = startTime.get();

Review Comment:
   Technically speaking, `startTime` is probably stable, so it might be a 
slightly better idea to use `AtomicLong` and 
`accumulateAndGet(res.getStartTime(), Math::min)`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jmeter.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to