Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculator used by Summary Report is inaccurate #1813

Closed
asfimport opened this issue Oct 18, 2006 · 2 comments
Closed

Calculator used by Summary Report is inaccurate #1813

asfimport opened this issue Oct 18, 2006 · 2 comments

Comments

@asfimport
Copy link
Collaborator

Rubén Laguna (Bug 40791):
Calculator.java used by SummaryReport uses the startTime of the first sample as
start time for it's own calculations. First sample to arrive to summary report
is not always the first sample in time because some operations may have started
earlier and will arrive later because the sample come from a jmeter-server (in
distributed testing with batch mode this is noticiable) or because the time to
complete the sample locally is high.

Furthermore Calculator (and Summary Report) take the endTime of the last sample
to arrive as the endTime for all SummaryReport calculations. This is worse
because in distributed testing the time is not always synchonized to the
millisecond and the samples come in batches.

This produces inaccuracy in the calculations. I'll attach a patch to correct
this behavior. Taking the min of samples startTime and the max of the samples
endTime

Severity: normal
OS: other

@asfimport
Copy link
Collaborator Author

Rubén Laguna (migrated from Bugzilla):
Changes the way SummaryReport calculates the thoughput taking into account the
min and max of startTimes and endTimes. Previous version relies on samples
coming in order to accurately make the calculations. This assumption is false
in distributed testing (very false in batch mode!)

Created attachment calculator.diff: Calculator.java patch to take min and max of startTimes and endTimes into account

calculator.diff
Index: C:/javaopt/eclipse/eclipse_workspaces/jmeter_workspace/JMeter2_2/src/core/org/apache/jmeter/util/Calculator.java
===================================================================
--- C:/javaopt/eclipse/eclipse_workspaces/jmeter_workspace/JMeter2_2/src/core/org/apache/jmeter/util/Calculator.java	(revision 454855)
+++ C:/javaopt/eclipse/eclipse_workspaces/jmeter_workspace/JMeter2_2/src/core/org/apache/jmeter/util/Calculator.java	(working copy)
@@ -105,7 +105,8 @@
         if (startTime == 0){
             startTime=res.getStartTime();
         }
-        elapsedTime=res.getEndTime()-startTime;
+        startTime = Math.min(startTime, res.getStartTime());
+        elapsedTime = Math.max(elapsedTime, res.getEndTime()-startTime);
     }
 
 

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
Thanks.

The code in SVN branch 2.2 has been fixed, and is in the nightly build:

2-2.20061020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant