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

Throughput Controller: change percent executions to total executions, the value is stored in a String and interpreted as 1 execution #2228

Closed
asfimport opened this issue Apr 29, 2009 · 2 comments

Comments

@asfimport
Copy link
Collaborator

@milamberspace (Bug 47120):
In throughput controller when change percent executions to total executions, the value is stored in a String and interpreted as 1 execution when JMeter running.

Version: Nightly
Severity: minor
OS: Linux

@asfimport
Copy link
Collaborator Author

@milamberspace (migrated from Bugzilla):
Patch to keep only "the left part" of throughput when the NumberFormatException into the method's modification

Created attachment proposal_patch_47120.txt: Proposal patch

proposal_patch_47120.txt
Index: /Workspaces-JMeter/Jmeter/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java
===================================================================
--- /Workspaces-JMeter/Jmeter/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java	(revision 769774)
+++ /Workspaces-JMeter/Jmeter/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java	(working copy)
@@ -78,7 +78,7 @@
             try {
                 ((ThroughputController) tc).setMaxThroughput(Integer.parseInt(throughput.getText().trim()));
             } catch (NumberFormatException e) {
-                ((ThroughputController) tc).setMaxThroughput(throughput.getText());
+                ((ThroughputController) tc).setMaxThroughput((throughput.getText().trim().split("\\.")[0]));
             }
         } else {
             try {
@@ -103,10 +103,10 @@
         super.configure(el);
         if (((ThroughputController) el).getStyle() == ThroughputController.BYNUMBER) {
             styleBox.getModel().setSelectedItem(BYNUMBER_LABEL);
-            throughput.setText(String.valueOf(((ThroughputController) el).getMaxThroughput()));
+            throughput.setText(((ThroughputController) el).getMaxThroughput());
         } else {
             styleBox.setSelectedItem(BYPERCENT_LABEL);
-            throughput.setText(String.valueOf(((ThroughputController) el).getPercentThroughput()));
+            throughput.setText(((ThroughputController) el).getPercentThroughput());
         }
         perthread.setSelected(((ThroughputController) el).isPerThread());
     }

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
Thanks for the patch - good work!

URL: http://svn.apache.org/viewvc?rev=770499&view=rev
Log:
#2228 - Throughput Controller: change percent executions to total executions, the value is stored in a String and interpreted as 1 execution

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